This function converts a Device Dependent Bitmap to a Device Independent Bitmap.

[C++Builder]     HANDLE IKDibFromBitmap(HBITMAP hBm, HPALETTE hPal);
[Delphi]         function IKDibFromBitmap(hBm: HBitmap; hPal: HPalette): THandle;

Parameters

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

Return Value

Returns the raster image handle if successful, otherwise returns 0 or NULL

Explanation

The IKBitmapFromDib function converts a Device Dependent Bitmap to a Device Independent Bitmap. If successful, the raster image handle will be returned. This function can be used to retrieve an image from C++Builder/Delhi TBitmap or VisualBasic PictureBox. Note: The hBm parameter is not freed after executing this function.

In Delphi:

   {Retrieve a raster image from TBitmap}
   var
      Bitmap1: TBitmap;
      ImageHandle: THandle;
   begin
      Bitmap1 := TBitmap.Create;
      try
         Bitmap1.LoadFromFile('C:\Bmp\001.bmp');
         {Image Processing 1}
         ImageHandle := IKDibFromBitmap(Bitmap1.Handle, Bitmap1.Palette);
         {Image Processing 2}
      finally
         Bitmap1.Free;
      end;
   end;

 

The ImageKit9 VCL is a product created by Newtone Corporation