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.
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.
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.