[Help] Drawing pixels on screen?[Solved]
How would you draw pixels on the screen? I know there is a SetPixel function but I don't know how to get it working..... I tried the following (NONE of it probably makes sense because I just typed anything):
[php]Public Class Form1
Private Declare Function SetPixel Lib "gdi32" Alias "SetPixel" (ByVal hdc As IntPtr, ByVal x As Integer, ByVal y As Integer, ByVal color As Integer) As Integer
Private Declare Function GetDC Lib "user32" Alias "GetDC" (ByVal wnd As IntPtr) As IntPtr
Private Declare Function ReleaseDC Lib "user32" Alias "ReleaseDC" (ByVal wnd As IntPtr, ByVal dc As IntPtr) As IntPtr
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SetPixel(GetDC(IntPtr.Zero), 500, 500, RGB(255, 0, 0))
ReleaseDC(IntPtr.Zero, GetDC(IntPtr.Zero))
End Sub
End Class
[/php]
[php]Public Class Form1
Private Declare Function SetPixel Lib "gdi32" Alias "SetPixel" (ByVal hdc As IntPtr, ByVal x As Integer, ByVal y As Integer, ByVal color As Integer) As Integer
Private Declare Function GetDC Lib "user32" Alias "GetDC" (ByVal wnd As IntPtr) As IntPtr
Private Declare Function ReleaseDC Lib "user32" Alias "ReleaseDC" (ByVal wnd As IntPtr, ByVal dc As IntPtr) As IntPtr
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SetPixel(GetDC(IntPtr.Zero), 500, 500, RGB(255, 0, 0))
ReleaseDC(IntPtr.Zero, GetDC(IntPtr.Zero))
End Sub
End Class
[/php]


