hey,
I have noticed around the following:
GetPixel / Set Pixel
GetPixelV / Set PixelV
Point / PSet
Which of these, or infact any other method the quickest for pixel operations within a picture box ?
Printable View
hey,
I have noticed around the following:
GetPixel / Set Pixel
GetPixelV / Set PixelV
Point / PSet
Which of these, or infact any other method the quickest for pixel operations within a picture box ?
There is no GetPixelV =). SetPixelV is the fastest, because it does not return the pixel value that was replaced.
Z.
What would the Quickes Get be then ?
Zaei - You know what its for ;)
GetPixel().
Yep =).
Z.
hmmm darn thing doesnt apear to want to work on my picture box.
i declared the API then did SetPixelV picmap.hdc, x, y, picmap.forecolor
balls.
it doesnt draw coz the AutoRedraw method is on. if i turn that off it works but when the box goes off the screen it gets cleared which ent good!!
Draw the pixel, then refresh.
Z.
Excellent.
Speedy app here i come lol
lol, maybe not.
Created a new project.
Added a picture box (auto redraw = false)
Added this codeChanged ScaleMode to Pixel
And nowt, wudnt draw anything.Code:
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 Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
SetPixelV Picture1.hdc, X, Y, vbBlack
Picture1.Refresh
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Caption = X & " " & Y
SetPixelV Me.hdc, X, Y, vbBlack
Me.Refresh
End Sub
got a way round it.
MouseDown AutoRedraw = True
Draw
MouseUp AutoRedraw = False
okay, that works all very well.
But. it only seems to take the vbWhite, vbBlack etc for the color and doesnt like it when i pass picLeft.BackColor