|
-
Jun 12th, 2000, 02:36 AM
#1
Thread Starter
Lively Member
How do I use SetPixel and GetPixel?
Frankie Weindel
VB 6 Learning Edtion SP3
-
Jun 12th, 2000, 04:36 AM
#2
transcendental analytic
Here's an example, getpixel is the same as point and setpixelv is the same as pset, except api's faster and you need to specify the dc
Code:
'In declarations
Declare Function SetPixelV Lib "gdi32" Alias "SetPixelV" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
'In code
Dim Color&
color = getpixel(picture1.hdc,10,10)
setpixelv picture2.hdc,15,5,vbred
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 12th, 2000, 04:42 AM
#3
Aslo, you should remember to set your Form's Autoredraw property to true and remember to refresh the Form after you have drawn on the DC.
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
|