Problem in Floodfill method

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
gangadhar

Problem in Floodfill method

Post by gangadhar »

Hi All,

I am using the MagickNet DLL in a web application. I need to

fill an area in my GIF image with a specific color and I used

the flood fill method. Now the area is always filled with

BLACK color.

Below is my sample code used:
protected void Page_Load(object sender, EventArgs e)
{
MagickNet.ImageList iml=new ImageList();
MagickNet.Image im = new MagickNet.Image

(Server.MapPath("images/sdf.jpg"));

MagickNet.Color c = new Color

(System.Drawing.Color.Transparent);

im.FloodFill(100, 100,

System.Drawing.Color.Transparent);

iml.Images.Add(im);

iml.Write(Server.MapPath("images/sdf1.jpg"));

}


Can anyone please help me in this regard ?

Thanks in Advance.

With Regards,
M. Gangadhar.
gangadhar

Re: Problem in Floodfill method

Post by gangadhar »

Hi All,

I have found a solution for the below mentioned issue.
I have set the Opacity to zero and then used the Flood fill method and it worked fine.


MagickNet.Color c = new Color (System.Drawing.Color.Transparent);
im.opacity = 0;
im.FloodFill(100, 100, c);

With Regards,
M. Gangadhar.
Post Reply