GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / FloodFill Method / FloodFill(Int32,Int32,Int32,Color) Method
GdPicture image identifier.
Specifies the x-coordinate, in pixel, of the point where filling is to start.
Specifies the y-coordinate, in pixel, of the point where filling is to start.
Color to use for the filling operation. A suitable color value can be obtained by using the ARGB() method.
Example





In This Topic
FloodFill(Int32,Int32,Int32,Color) Method
In This Topic
Fills an area of unified color in a GdPicture image with a specific color.
Syntax
'Declaration
 
Public Overloads Function FloodFill( _
   ByVal ImageID As Integer, _
   ByVal XStart As Integer, _
   ByVal YStart As Integer, _
   ByVal FillColor As Color _
) As GdPictureStatus
public GdPictureStatus FloodFill( 
   int ImageID,
   int XStart,
   int YStart,
   Color FillColor
)
public function FloodFill( 
    ImageID: Integer;
    XStart: Integer;
    YStart: Integer;
    FillColor: Color
): GdPictureStatus; 
public function FloodFill( 
   ImageID : int,
   XStart : int,
   YStart : int,
   FillColor : Color
) : GdPictureStatus;
public: GdPictureStatus FloodFill( 
   int ImageID,
   int XStart,
   int YStart,
   Color FillColor
) 
public:
GdPictureStatus FloodFill( 
   int ImageID,
   int XStart,
   int YStart,
   Color FillColor
) 

Parameters

ImageID
GdPicture image identifier.
XStart
Specifies the x-coordinate, in pixel, of the point where filling is to start.
YStart
Specifies the y-coordinate, in pixel, of the point where filling is to start.
FillColor
Color to use for the filling operation. A suitable color value can be obtained by using the ARGB() method.

Return Value

A member of the GdPictureStatus enumeration.
Remarks
This method or an overload of it is used in the "Image Processing" VB.NET Demo.
Example
Filling an area of unified color in a jpeg image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    // LoadInMemory parameter is set to true in order to be able to update the input file.
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.jpg", true);
 
    // Fills an area of unified color.                
    gdpictureImaging.FloodFill(imageID, 5, 5, Color.Red);
    gdpictureImaging.SaveAsPNG(imageID, "image.png");
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also