Results 1 to 3 of 3

Thread: Get/Set a point on a PictureBox Class

  1. #1

    Thread Starter
    Frenzied Member macai's Avatar
    Join Date
    Jul 2001
    Location
    Napanoch NY
    Posts
    1,228

    Get/Set a point on a PictureBox Class

    I need to set a point on a PictureBox class to a certain color. I'll also need to read this point. This point of course, has to be based on x/y coordinates.

    Is there any way to do this?

    Also, I'm using the freeware Mono C# compiler, so no fancy IDE for me.
    Luke

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Get/Set a point on a PictureBox Class

    You should use the Bitmap Class and call its GetPixel/SetPixel functions.

    Unless you want maximum performance, in which case you should use LockBits/UnlockBits and pointers into the contiguous pixel data, this should only be done if you are setting / testing a lot of pixels.

    The latter is complicated so give SetPisel a whirl first, it may be fast enough for you on its own.
    I don't live here any more.

  3. #3

    Thread Starter
    Frenzied Member macai's Avatar
    Join Date
    Jul 2001
    Location
    Napanoch NY
    Posts
    1,228

    Re: Get/Set a point on a PictureBox Class

    Thanks, I'll check both of them out.

    And yes, I will be setting/getting alot of pixels. I'm writing a stupid game that has a gameplay style similar to Sam & Max Hit the Road or Day of the TEntacle.

    Thanks again. Have a good one.
    Luke

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