1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
| Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC 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 dwRop As Long) As Long
Const SRCCOPY = &HCC0020 ' destination et source identiques
Const SRCPAINT = &HEE0086 ' destination = source OU destination
Const SRCAND = &H8800C6 ' destination = source ET destination
Private Declare Function TransparentBlt Lib "msimg32" _
(ByVal hdcDest As Long, ByVal nXOriginDest As Long, _
ByVal nYOriginDest As Long, ByVal nWidthDest As Long, _
ByVal nHeightDest As Long, ByVal hdcSrc As Long, _
ByVal nXOriginSrc As Long, ByVal nYOriginSrc As Long, _
ByVal nWidthSrc As Long, ByVal nHeightSrc As Long, _
ByVal crTransparent As Long) As Long
Private Sub dodo() Dim TransparentColor As Long
TransparentColor = RGB(255, 255, 255)
With Picture2
TransparentBlt Me.hdc, 0, 0, .ScaleWidth, .ScaleHeight, .hdc, 0, 0, .ScaleWidth, .ScaleHeight, TransparentColor
End With
Me.Refresh
End Sub
Private Sub Form_Activate()
' CES PROPRIETES SONT TRES IMPORTANTES ----- NE SURTOUT PAS LES OMETTRE - PEUVENT ETRE BIEN SUR EN DUR
picture1.AutoRedraw = True
picture1.AutoSize = True
Picture2.AutoRedraw = True
picture1.DrawStyle = 1
Picture2.DrawStyle = 1
picture1.ScaleMode = 3
Picture2.ScaleMode = 3
Picture2.Visible = False
End Sub
Private Sub recouvrir_Click()
Dim retour As Integer
picture1.Cls
retour = BitBlt(picture1.hdc, 0, 0, picture1.Width, picture1.Height, Picture2.hdc, 0, 0, SRCCOPY)
End Sub
Private Sub lesplusforts_Click()
Dim retour As Integer
picture1.Cls
retour = BitBlt(picture1.hdc, 0, 0, picture1.Width, picture1.Height, Picture2.hdc, 0, 0, SRCPAINT)
End Sub
Private Sub superposer_Click()
dodo
Dim retour As Integer
picture1.Cls
retour = BitBlt(picture1.hdc, 0, 0, picture1.Width, picture1.Height, Picture2.hdc, 0, 0, SRCAND)
End Sub |
Partager