|
-
Mar 13th, 2003, 10:54 AM
#1
Thread Starter
Member
what is the .net equivalent of PSet? *RESOLVED*
i want to set a pixel. how do i do this?
Last edited by Atomon; Mar 14th, 2003 at 07:08 AM.
-
Mar 14th, 2003, 12:42 AM
#2
Junior Member
You can do use SetPixel function of Bitmap object.
Public Sub SetPixel_Example(e As PaintEventArgs)
' Create a Bitmap object of 100x100 pixels.
Dim myBitmap As New Bitmap(100,100)
' Draw myBitmap to the screen.
e.Graphics.DrawImage(myBitmap, 0, 0, myBitmap.Width, _
myBitmap.Height)
' Set each pixel in myBitmap to black.
Dim Xcount As Integer
For Xcount = 0 To myBitmap.Width - 1
Dim Ycount As Integer
For Ycount = 0 To myBitmap.Height - 1
myBitmap.SetPixel(Xcount, Ycount, Color.Black)
Next Ycount
Next Xcount
' Draw myBitmap to the screen again.
e.Graphics.DrawImage(myBitmap, myBitmap.Width, 0, myBitmap.Width, _
myBitmap.Height)
End Sub
-
Mar 14th, 2003, 07:08 AM
#3
Thread Starter
Member
nevermind, i just made a circle with a radius of one.
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
|