|
-
Nov 26th, 2000, 02:59 PM
#1
Thread Starter
New Member
is there any way to check in a picbox if a pixel is painted over more than once and then change the color?
-
Nov 26th, 2000, 03:14 PM
#2
Use can use GetPixel and SetPixel API's to read and draw pixels.
Code:
Private Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function SetPixel Lib "gdi32" Alias "SetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
Usage
Code:
'Get a Pixel
lColour = GetPixel(Picture1.hDC, 5, 5)
'Draw a Pixel
SetPixel(Picture1.hDC, 5, 5)
-
Nov 26th, 2000, 05:18 PM
#3
Thread Starter
New Member
more help
how do i check if a pixel has been painted over more than once?
-
Nov 26th, 2000, 05:26 PM
#4
You would have to have a timer constantly monitoring it. for example sake, let's assume the Pixel should normally be coloured blue.
Code:
Private Sub Timer1_Timer()
lColour = GetPixel(Picture1.hDC, 5, 5)
If lColour <> vbBlue Then '<--the colour has changed
End Sub
-
Nov 29th, 2000, 10:17 PM
#5
Thread Starter
New Member
No One?
No one knows how to check if a pixel has been painted over more than once?
-
Dec 1st, 2000, 11:13 AM
#6
Fanatic Member
Silvertine, the code that Megatron gave you is the best you can have for this. There's no better way. Sorry.
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
|