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





In This Topic
ConvertTo8Bpp216 Method (GdPictureImaging)
In This Topic
Converts a GdPicture image to an 8-bit indexed color image using a standard color palette. This method uses an automatic segmentation components algorithm. The color table has a maximum of 256 entries but only 216 will be used.
Syntax
'Declaration
 
Public Function ConvertTo8Bpp216( _
   ByVal ImageID As Integer _
) As GdPictureStatus
public GdPictureStatus ConvertTo8Bpp216( 
   int ImageID
)
public function ConvertTo8Bpp216( 
    ImageID: Integer
): GdPictureStatus; 
public function ConvertTo8Bpp216( 
   ImageID : int
) : GdPictureStatus;
public: GdPictureStatus ConvertTo8Bpp216( 
   int ImageID
) 
public:
GdPictureStatus ConvertTo8Bpp216( 
   int ImageID
) 

Parameters

ImageID
GdPicture image identifier.

Return Value

A member of the GdPictureStatus enumeration.
Example
Converting a bmp to a png and setting white as transparent color.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.bmp", false);
 
    // Convert to an 8-bit indexed color image using a standard color palette, set white as transparent and save to png.
    gdpictureImaging.ConvertTo8Bpp216(imageID);
    gdpictureImaging.PaletteSetTransparentColor(imageID, Color.White);
    gdpictureImaging.SaveAsPNG(imageID, "image.png", 6, false);
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also