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





In This Topic
ConvertTo24BppRGB Method (GdPictureImaging)
In This Topic
Converts a GdPicture image to a 24-bit color image. 8 bits each are used for the red, green, and blue components.
Syntax
'Declaration
 
Public Function ConvertTo24BppRGB( _
   ByVal ImageID As Integer _
) As GdPictureStatus
public GdPictureStatus ConvertTo24BppRGB( 
   int ImageID
)
public function ConvertTo24BppRGB( 
    ImageID: Integer
): GdPictureStatus; 
public function ConvertTo24BppRGB( 
   ImageID : int
) : GdPictureStatus;
public: GdPictureStatus ConvertTo24BppRGB( 
   int ImageID
) 
public:
GdPictureStatus ConvertTo24BppRGB( 
   int ImageID
) 

Parameters

ImageID
GdPicture image identifier.

Return Value

A member of the GdPictureStatus enumeration.
Remarks

This method requires the Image Documents component to run.

Example
Converting an image to a 24-bit RGB color image and saving the result into a PNG file.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    // Open an image file. An empty string allows the control to prompt for selecting a file.
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("");
 
    // Convert the image to 24-bit RGB color format. Any transparency will be lost.
    gdpictureImaging.ConvertTo24BppRGB(imageID);
    gdpictureImaging.SaveAsPNG(imageID, "output.png");
 
    // Release used resources.
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also