GdPicture.NET Reference Guide
GetHBitmapFromGdPictureImage Method
Example 





GdPicture14 Namespace > GdPictureImaging Class : GetHBitmapFromGdPictureImage Method
GdPicture Image Identifier. The GdPicture image to export as HBitmap.
Exports a GdPicture image to a HBitmap.
Syntax
'Declaration
 
Public Function GetHBitmapFromGdPictureImage( _
   ByVal ImageID As Integer _
) As IntPtr
public IntPtr GetHBitmapFromGdPictureImage( 
   int ImageID
)
public function GetHBitmapFromGdPictureImage( 
    ImageID: Integer
): IntPtr; 
public function GetHBitmapFromGdPictureImage( 
   ImageID : int
) : IntPtr;
public: IntPtr GetHBitmapFromGdPictureImage( 
   int ImageID
) 
public:
IntPtr GetHBitmapFromGdPictureImage( 
   int ImageID
) 

Parameters

ImageID
GdPicture Image Identifier. The GdPicture image to export as HBitmap.

Return Value

A new HBitmap handle which will contain the specified GdPicture image data.
Remarks
Use the GetStat() method to see if this method Succeeded. Do not forget to release the HBitmap object with the ReleaseHBitmap() method.
Example
How to import/export a GdPicture image from/to an HBITMAP.
Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("input.png")
If imageId <> 0 Then
   Dim HBitmap As IntPtr = oGdPictureImaging.GetHBitmapFromGdPictureImage(ImageID)
   'doing some external processing on the HBitmap
   Dim ResImg As Integer = oGdPictureImaging.CreateGdPictureImageFromHBitmap(HBitmap)
   oGdPictureImaging.ReleaseGdPictureImage(ImageID)
   oGdPictureImaging.ReleaseHBitmap(HBitmap)
End If
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members
GetStat Method
ReleaseHBitmap Method