Results 1 to 3 of 3

Thread: what is the .net equivalent of PSet? *RESOLVED*

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2002
    Location
    long island, new york
    Posts
    32

    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.

  2. #2
    Junior Member
    Join Date
    Mar 2003
    Posts
    16
    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
    vijay pahuja
    mumbai

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2002
    Location
    long island, new york
    Posts
    32
    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
  •  



Click Here to Expand Forum to Full Width