|
Option Explicit
Private Declare Function CreateSolidBrush Lib "gdi32" ( _
ByVal crColor As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal _
hdc As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal _
hObject As Long) As Long
Private Declare Function ExtFloodFill Lib "gdi32" (ByVal _
hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal _
crColor As Long, ByVal wFillType As Long) As Long
Private Const FLOODFILLSURFACE = 1
Private Sub picImage_MouseDown(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
Dim hBrush As Long
hBrush = CreateSolidBrush(picAuswahl.BackColor)
With picImage
SelectObject .hdc, hBrush
ExtFloodFill .hdc, X, Y, .Point(X, Y), FLOODFILLSURFACE
DeleteObject hBrush
End With
End Sub
Private Sub picFarben_MouseDown(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
picAuswahl.BackColor = picFarben.Point(X, Y)
End Sub
Private Sub picFarben_MouseMove(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
On Error Resume Next
picVorschau.BackColor = picFarben.Point(X, Y)
End Sub
|
|