|
-
Sep 19th, 2002, 01:15 PM
#1
Thread Starter
Frenzied Member
Quickest Pixel Methods
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 ?
-
Sep 19th, 2002, 01:17 PM
#2
Frenzied Member
There is no GetPixelV =). SetPixelV is the fastest, because it does not return the pixel value that was replaced.
Z.
-
Sep 19th, 2002, 01:19 PM
#3
Thread Starter
Frenzied Member
What would the Quickes Get be then ?
Zaei - You know what its for
-
Sep 19th, 2002, 01:20 PM
#4
Frenzied Member
-
Sep 19th, 2002, 01:22 PM
#5
Thread Starter
Frenzied Member
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
-
Sep 19th, 2002, 01:34 PM
#6
Thread Starter
Frenzied Member
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!!
-
Sep 19th, 2002, 01:53 PM
#7
Frenzied Member
Draw the pixel, then refresh.
Z.
-
Sep 19th, 2002, 01:56 PM
#8
Thread Starter
Frenzied Member
Excellent.
Speedy app here i come lol
-
Sep 19th, 2002, 02:05 PM
#9
Thread Starter
Frenzied Member
lol, maybe not.
Created a new project.
Added a picture box (auto redraw = false)
Added this codeChanged ScaleMode to Pixel
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
And nowt, wudnt draw anything.
-
Sep 19th, 2002, 02:07 PM
#10
Thread Starter
Frenzied Member
got a way round it.
MouseDown AutoRedraw = True
Draw
MouseUp AutoRedraw = False
-
Sep 19th, 2002, 02:11 PM
#11
Thread Starter
Frenzied Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|