This method converts a Device Dependent Bitmap to a Device Independent Bitmap
[Visual Basic]   [Boolean = ]imagekitcontrolname.DibFromBitmap(hBm As LONG_PTR, hPal As LONG_PTR)
[Visual C++]     [BOOL = ]imagekitcontrolname.DibFromBitmap(LONG_PTR hBm, LONG_PTR hPal)
[VB.NET]   [Boolean = ]imagekitcontrolname.DibFromBitmap(hBm As Integer(x86) or Long(x64), hPal As Integer(x86) or Long(x64))
[C#.NET]   [bool = ]imagekitcontrolname.DibFromBitmap(int(x86) or long(x64) hBm, int(x86) or long(x64) hPal)

* (x86) refers to the 32 bit version, (x64) refers to the 64 bit version.

Parameters

Name Explanation
hBm The bitmap handle
hPal The bitmap palette (0 if there is no palette)

Return Value

Returns True (nonzero) if successful, otherwise returns False (0).

Explanation

The DibFromBitmap method converts a Device Dependent Bitmap to a Device Independent Bitmap. If successful, the image handle is set in the LayerNo property (ImageHandle property or Layer(LayerNo).ImageHandle property).

This method can be used to retrieve an image from VisualBasic PictureBox.

Note: The argument hBm is not freed after executing this method.


In Visual Basic:

  ' Retrieve a raster image from a PictureBox

  Set Picture1.Picture = LoadPicture("C:\Bmp\001.bmp")

  ' Image Processing 1

  ImageKit1.LayerNo = -1

  ImageKit1.DibFromBitmap Picture1.Picture.Handle, Picture1.Picture.hPal

  ' Image Processing 2

  

Differences from ImageKit7/8

  This method's argument type has changed

 

The ImageKit10 ActiveX is a product created by Newtone Corporation