GetDIB example for Delphi
var
MyDIB: L_HANDLE;
begin
{This example gets the image from LEADImage1 as a V5 DIB
and then loads the DIB into LEADImage2}
{LEAD1 has an image at this point}
MyDIB:= LEADImage1.GetDIB(DIB_BITMAPV5HEADER);
LEADImage2.SetDIB (MyDIB);
{Free the DIB using the Windows API}
GlobalFree ( MyDIB ) ;
end;