←Select platform

ToHBitmap(RasterImage,IntPtr) Method

Summary

Creates a Windows Device-Dependent Bitmap (DDB) from a Leadtools.RasterImage.

Syntax

C#
VB
C++
public static IntPtr ToHBitmap( 
   RasterImage image, 
   IntPtr hdc 
) 
Public Overloads Shared Function ToHBitmap( _ 
   ByVal image As Leadtools.RasterImage, _ 
   ByVal hdc As IntPtr _ 
) As IntPtr 
public: 
static IntPtr ToHBitmap(  
   Leadtools.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 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

Help Version 19.0.2017.10.18
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Drawing Assembly