Option Explicit

    Dim SelectedColor As Long
    Dim SelectedPictureFile As String
    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 Sub Pic_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button = 1 Then
            pic.FillColor = SelectedColor
            Call ExtFloodFill(pic.hdc, X, Y, pic.Point(X, Y), 1)
        End If
End Sub




Private Sub picPallete_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If picPallete.Point(X, Y) > -1 Then
        SelectedColor = picPallete.Point(X, Y)
        lblColor.BackColor = SelectedColor
    End If
End Sub
