This function converts the image data from a Device Independent Bitmap(DIB) to a Device Dependent Bitmap (DDB).

[C++Builder]     HBITMAP IKBitmapFromDib(HANDLE Handle);
[Delphi]         function IKBitmapFromDib(Handle: THandle): HBitmap;

Parameters

Name Explanation
Handle The image handle of the raster image

Return Value

Returns the Bitmap handle if successful, otherwise returns 0 or null.

Explanation

The IKBitmapFromDib function converts the image data from a Device Independent Bitmap(DIB) to a Device Dependent Bitmap (DDB). This function can be used to pass an image to C++Builder and Delphi TBitmap.

Note the image data passed by the Handle parameter is NOT freed after this function is executed.

In Delphi:

   {Set a raster image in TBitmap}
   var
      Bitmap1: TBitmap;
      ImageHandle: THandle;
   begin
      ImageHandle := IKFileLoad('C:\Png\001.png', 0, 0, 0, 0, nil, nil, nil);
      Bitmap1 := TBitmap.Create;
      try
         Bitmap1.Handle := IKBitmapFromDib(ImageHandle);
         {Image Processing}
      finally
         Bitmap1.Free;
         IKFreeMemory(ImageHandle);
      end;
   end;

 

The ImageKit9 VCL is a product created by Newtone Corporation