how can i use CopyMemory() on VB6?
i have these funcion:
Public Sub Clear(BGRColor As Long)
Dim i As Long
For i = 0 To (Width * Height) - 1
CopyMemory ByVal PixelData(0) + (i * 4), vbGreen, 4
Next i
End Sub
how can avoid the 'for' loop?
i tried:
Public Sub Clear2(BGRColor As Long)
Dim i As Long
i = ((Width * Height) - 1) * 4
CopyMemory ByVal PixelData(0), vbGreen, i
End Sub
but seems that i fail on 'i' calculation(array size)... maybe because we have 4 bytes by a pixel?