LEADTOOLS GDI/GDI+ (Leadtools.Drawing assembly)
LEAD Technologies, Inc

ToHBitmap(RasterImage,IntPtr) Method






The source image
Handle to the Windows device responsible for the conversion. The mapping mode of the device context must be MM_TEXT.
Creates a Windows Device-Dependent Bitmap (DDB) from a Leadtools.RasterImage.
Syntax
public static IntPtr ToHBitmap( 
   RasterImage image,
   IntPtr hdc
)
'Declaration
 
Public Overloads Shared Function ToHBitmap( _
   ByVal image As RasterImage, _
   ByVal hdc As IntPtr _
) As IntPtr
'Usage
 
Dim image As RasterImage
Dim hdc As IntPtr
Dim value As IntPtr
 
value = RasterImageConverter.ToHBitmap(image, hdc)
public static IntPtr ToHBitmap( 
   RasterImage image,
   IntPtr hdc
)
 function Leadtools.Drawing.RasterImageConverter.ToHBitmap(RasterImage,IntPtr)( 
   image ,
   hdc 
)
public:
static IntPtr ToHBitmap( 
   RasterImage^ image,
   IntPtr hdc
) 

Parameters

image
The source image
hdc
Handle to the Windows device responsible for the conversion. The mapping mode of the device context must be MM_TEXT.

Return Value

A handle to the Windows DDB this method creates.
Remarks

Converts a Leadtools.RasterImage object into a Windows device dependent bitmap (DDB). When this method is completed, there are two copies of the image in memory: the DDB and the original Leadtools.RasterImage. Freeing one will not affect the other.

NOTE: This method returns the data in an unmanaged handle. The caller is responsible for freeing the DDB's handle when it is no longer needed using the the DeleteObject Windows API, otherwise, your application will leak resources.

For more information on DDBs and DIBs, refer to Using DIBs, DDBs, and the Clipboard.

For more information refer to RasterImage and GDI/GDI+.

Example
For an example, refer to FromHBitmap(IntPtr,IntPtr).
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

RasterImageConverter Class
RasterImageConverter Members
Overload List
FromHBitmap(IntPtr,IntPtr) Method
ChangeFromHBitmap(IntPtr,IntPtr) Method
ChangeToHBitmap(RasterImage) Method
RasterImage.FromDib
RasterImage.ToDib
RasterImage.ChangeFromDib
RasterImage.ChangeToDib

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.