VB Code:
Option Explicit
Private Declare Function SetPixelV Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
Private Sub Form_Load()
' Make the Image Box Twice the Size of the Picturebox
' And set it to Stretch it's Contents to Fit
With Picture1
Image1.Move .Left + .Width, .Top, .Width * 2, .Height * 2
Image1.Stretch = True
End With
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = vbLeftButton Then
With Picture1
.AutoRedraw = True ' Make sure the Pixels Persist
Call SetPixelV(.hdc, .ScaleX(x, .ScaleMode, vbPixels), .ScaleY(y, .ScaleMode, vbPixels), vbBlack)
' Transfer the Edited "Image" to the "Picture"
.Picture = .Image
' Now you can assign the Picture to the Image Control
Image1 = .Picture
End With
End If
End Sub