GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / FxPixelize Method
GdPicture image identifier.
Example





In This Topic
FxPixelize Method (GdPictureImaging)
In This Topic
Performs "pixelize" effect on a GdPicture image or on an area of a GdPicture image defined by SetROI() method. This filter makes the image appear as pixelated.
Syntax
'Declaration
 
Public Function FxPixelize( _
   ByVal ImageID As Integer _
) As GdPictureStatus
public GdPictureStatus FxPixelize( 
   int ImageID
)
public function FxPixelize( 
    ImageID: Integer
): GdPictureStatus; 
public function FxPixelize( 
   ImageID : int
) : GdPictureStatus;
public: GdPictureStatus FxPixelize( 
   int ImageID
) 
public:
GdPictureStatus FxPixelize( 
   int ImageID
) 

Parameters

ImageID
GdPicture image identifier.

Return Value

A member of the GdPictureStatus enumeration.
Remarks
This method is used in the "Image Processing" Demo.
Example
Cloning an area of a jpeg image into a new jpeg image, then performing the "pixelize" effect on the cloned image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    using (System.IO.Stream inputStream = new System.IO.FileStream("image.jpg", System.IO.FileMode.Open))
    {
        int imageID1 = gdpictureImaging.CreateGdPictureImageFromStream(inputStream, GdPicture14.DocumentFormat.DocumentFormatJPEG);
        //Clone an area of the source image into a mew image.
        int imageID2 = gdpictureImaging.CreateClonedGdPictureImageArea(imageID1, 50, 50, 100, 250);
        //Process the cloned image.
        gdpictureImaging.FxPixelize(imageID2);
        using (System.IO.Stream outputStream = new System.IO.FileStream("output.png", System.IO.FileMode.CreateNew))
        {
            //Save a result into a new image file.
            gdpictureImaging.SaveAsStream(imageID2, outputStream, GdPicture14.DocumentFormat.DocumentFormatPNG, 6);
        }
        gdpictureImaging.ReleaseGdPictureImage(imageID2);
        gdpictureImaging.ReleaseGdPictureImage(imageID1);
    }
}
See Also