Groups | Blog | Home
all groups > dotnet drawing api > october 2003 >

dotnet drawing api : Set region on a bitmap


Crirus
10/29/2003 6:10:25 PM
Hello
I draw a bitmap pixel by pixel
There is a way to set region on the bitmap where the setpixel take effect
and regions where not?

Thanks,
Crirus

Bob Powell [MVP]
10/29/2003 6:18:17 PM
[quoted text, click to view]

No, the only way to do this is to draw on the bitmap using a Graphics object
obtained using Graphics.FromBitmap and set a clipping region using SetClip.
If you use SetPixel then it's up to you to check whether the pixel is valid
or not.

--
Bob Powell [MVP]
C#, System.Drawing

The October edition of Well Formed is now available.
Find out how to use DirectX in a Windows Forms control
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Blog http://bobpowelldotnet.blogspot.com

[quoted text, click to view]

Crirus
10/29/2003 7:47:14 PM
I was forced to do that:
Draw only the pixels on bounding rectangle of my region with setPixel and
then redraw the bitmap with graphics on a clipped new bitmap.
I was trying only setpixel with pathRegion.IsVisible for each point of
bitmap, to chech if that pixel is valid but IsVisible is incredible slow




[quoted text, click to view]

AddThis Social Bookmark Button