cs_DARKSIDIOUS
Messages postés
15814
Date d'inscription
jeudi 8 août 2002
Statut
Membre
Dernière intervention
4 mars 2013
130
15 sept. 2005 à 20:06
Bon voici une version qui marche très bien :
Private Declare Function TransparentBlt Lib "msimg32.dll" ( _
ByVal hdc As Long, _
ByVal x As Long, _
ByVal y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal hSrcDC As Long, _
ByVal xSrc As Long, _
ByVal ySrc As Long, _
ByVal nSrcWidth As Long, _
ByVal nSrcHeight As Long, _
ByVal crTransparent As Long) As Long
Private Declare Function CreateSolidBrush Lib "gdi32.dll" ( _
ByVal crColor As Long) As Long
Private Declare Function CreatePen Lib "gdi32.dll" ( _
ByVal nPenStyle As Long, _
ByVal nWidth As Long, _
ByVal crColor As Long) As Long
Private Declare Function SelectObject Lib "gdi32.dll" ( _
ByVal hdc As Long, _
ByVal hObject As Long) As Long
Private Declare Function Ellipse Lib "gdi32.dll" ( _
ByVal hdc As Long, _
ByVal X1 As Long, _
ByVal Y1 As Long, _
ByVal X2 As Long, _
ByVal Y2 As Long) As Long
Private Sub Picture3_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim lBrush As Long
Dim lPen As Long
If Not Picture3.AutoRedraw Then Let Picture3.AutoRedraw = True
If lBrush = 0 Then
Let lBrush = CreateSolidBrush(vbBlue)
Call SelectObject(Picture2.hdc, lBrush)
End If
If lPen = 0 Then
Let lPen = CreatePen(0, 1, vbBlue)
Call SelectObject(Picture2.hdc, lPen)
End If
Call Ellipse(Picture2.hdc, x - 10, y - 10, x + 10, y + 10)
Set Picture3.Picture = Picture1.Picture
Call TransparentBlt(Picture3.hdc, 0, 0,
Picture3.ScaleWidth, Picture3.ScaleHeight, Picture2.hdc, 0, 0,
Picture2.ScaleWidth, Picture2.ScaleHeight, vbBlue)
End Sub
_____________________________________________________________________
DarK Sidious
Un API Viewer (pour le VB, VB.NET, C, C# et Delphi) tout en français : www.ProgOtoP.com/popapi/