using ExtFloodFill from GDI

  • Thread starter Thread starter pixel
  • Start date Start date
P

pixel

hi

i know there is no ExtFloodFill in GDI+
so i decided to use GDI
but there is something that i don't understand

when i got DC from ie PictureBox
like this
Graphics g = PictureBox.CreateGraphics();
IntPtr hdc = g.GetHdc();

then ExtFloodFill on this hdc works perfectly ok

but when i got hdc from bitmap
like this
Image i = new Bitmap(100, 100);
Graphics g = Graphics.FromImage(i);
IntPtr hdc = g.GetHdc();

then ExtFloodFill fills whole bitmap

ofcourse on both graphics there is circle or something like this!!!

and ofcourse other GDI functions work on both hdc
ie SetPixel or Rectangle works perfectly ok
so why ExtFloodFill has different products???

br
pixel
 
Hi!

A blind guess - possible differences in the pixel format due to which
ExtFloodFill fails to 'see' the circle's (or something else's) border.
 
hi dimitriy

i also thought so
so i did
compatible dc from pixturebox
and compatible bitmap into this dc

and unfortunatelly it still doesn't work :(((

i have no more ideas

pixel

Dmitriy Lapshin said:
Hi!

A blind guess - possible differences in the pixel format due to which
ExtFloodFill fails to 'see' the circle's (or something else's) border.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

pixel said:
hi

i know there is no ExtFloodFill in GDI+
so i decided to use GDI
but there is something that i don't understand

when i got DC from ie PictureBox
like this
Graphics g = PictureBox.CreateGraphics();
IntPtr hdc = g.GetHdc();

then ExtFloodFill on this hdc works perfectly ok

but when i got hdc from bitmap
like this
Image i = new Bitmap(100, 100);
Graphics g = Graphics.FromImage(i);
IntPtr hdc = g.GetHdc();

then ExtFloodFill fills whole bitmap

ofcourse on both graphics there is circle or something like this!!!

and ofcourse other GDI functions work on both hdc
ie SetPixel or Rectangle works perfectly ok
so why ExtFloodFill has different products???

br
pixel
 
Back
Top