Leadtools Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.3.5
ChangeToDib Method
See Also 
Leadtools Namespace > RasterImage Class : ChangeToDib Method




type
Type of DIB to create. Possible values are:
ValueMeaning
RasterConvertToDibType.BitmapInfoHeaderDIB that uses a BITMAPINFOHEADER
RasterConvertToDibType.BitmapV4HeaderDIB that uses a BITMAPV4HEADER. (Introduced in Windows 95 and Windows NT 4.0)
RasterConvertToDibType.BitmapV5HeaderDIB that uses a BITMAPV5HEADER (Introduced in Windows 2000 and Windows 98)
Changes a LEAD RasterImage object to a Windows Device Independent Bitmap (DIB).

Syntax

Visual Basic (Declaration) 
Public Function ChangeToDib( _
   ByVal type As RasterConvertToDibType _
) As IntPtr
Visual Basic (Usage)Copy Code
Dim instance As RasterImage
Dim type As RasterConvertToDibType
Dim value As IntPtr
 
value = instance.ChangeToDib(type)
C# 
public IntPtr ChangeToDib( 
   RasterConvertToDibType type
)
Managed Extensions for C++ 
public: IntPtr ChangeToDib( 
   RasterConvertToDibType type
) 
C++/CLI 
public:
IntPtr ChangeToDib( 
   RasterConvertToDibType type
) 

Parameters

type
Type of DIB to create. Possible values are:
ValueMeaning
RasterConvertToDibType.BitmapInfoHeaderDIB that uses a BITMAPINFOHEADER
RasterConvertToDibType.BitmapV4HeaderDIB that uses a BITMAPV4HEADER. (Introduced in Windows 95 and Windows NT 4.0)
RasterConvertToDibType.BitmapV5HeaderDIB that uses a BITMAPV5HEADER (Introduced in Windows 2000 and Windows 98)

Return Value

A handle to the device independent bitmap (DIB) this method creates.

Example

This example loads a RasterImage, changes it to a V5 DIB and writes out the DIB as a bitmap file.

Remarks

A DIB consists of one of the following:

  • a BITMAPFILEHEADER,
  • a BITMAPV4HEADER (introduced in Windows 95 and Windows NT 4.0),
  • or a BITMAPV5HEADER (introduced in Windows 2000 and Windows 98),

followed by a color table and then the bitmap data. The resulting DIB type is determined by the value of the type parameter.

The orientation of the image and color order will depend on how the image was loaded into the RasterImage.

When you no longer need the DIB, you can free it using the Windows GlobalFree function.

This method does not support signed data images. It will throw an exception of type RasterException with code value RasterExceptionCode.SignedDataNotSupported if this RasterImage has a signed data image.

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

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also