Leadtools Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
ToHBitmap(IntPtr) Method
See Also 
Leadtools Namespace > RasterImage Class > ToHBitmap Method : ToHBitmap(IntPtr) Method



hdc
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 this RasterImage.

Syntax

Visual Basic (Declaration) 
Public Overloads Function ToHBitmap( _
   ByVal hdc As IntPtr _
) As IntPtr
Visual Basic (Usage)Copy Code
Dim instance As RasterImage
Dim hdc As IntPtr
Dim value As IntPtr
 
value = instance.ToHBitmap(hdc)
C# 
public IntPtr ToHBitmap( 
   IntPtr hdc
)
C++/CLI 
public:
IntPtr ToHBitmap( 
   IntPtr hdc
) 

Parameters

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.

Example

For an example, refer to ToHBitmap

Remarks

Converts a 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 RasterImage. Freeing one will not affect the other.

NOTE: This method returns the data in an unmanaged handle. The caller is repsonsible 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.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also