GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / GetBitmapFromGdPictureImage Method
A unique image identifier of the GdPicture image representing the image to export.
Example





In This Topic
GetBitmapFromGdPictureImage Method
In This Topic
Returns a Bitmap object from a GdPicture image.
Syntax
'Declaration
 
Public Function GetBitmapFromGdPictureImage( _
   ByVal ImageID As Integer _
) As Bitmap
public Bitmap GetBitmapFromGdPictureImage( 
   int ImageID
)
public function GetBitmapFromGdPictureImage( 
    ImageID: Integer
): Bitmap; 
public function GetBitmapFromGdPictureImage( 
   ImageID : int
) : Bitmap;
public: Bitmap* GetBitmapFromGdPictureImage( 
   int ImageID
) 
public:
Bitmap^ GetBitmapFromGdPictureImage( 
   int ImageID
) 

Parameters

ImageID
A unique image identifier of the GdPicture image representing the image to export.

Return Value

A Bitmap object. The exported Bitmap image.
Remarks

The exported Bitmap object will have the same pixel source as a GdPicture image. Therefore, if you remove the GdPicture image from memory you will remove at same time the exported Bitmap data.

Use the GetStat() method to check if this method succeeded.

This method requires the Image Documents component to run.

Example
Getting a Bitmap object from a GdPicture image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.jpg", false);
 
    // Get a System.Drawing.Bitmap object and save it to a file.
    using (Bitmap bitmap = gdpictureImaging.GetBitmapFromGdPictureImage(imageID))
    {
        bitmap.Save("image.png");
    }
 
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also