ImageEn, unit iexBitmaps

TIEBitmap.CopyFromDIB

TIEBitmap.CopyFromDIB

Declaration

procedure CopyFromDIB(Source: THandle); overload;
procedure CopyFromDIB(BitmapInfo: Pointer; Pixels: Pointer = nil); overload;

Description

Copies from the specified DIB handle.
The second overload copies from a DIB composed by a BitmapInfo structure and pixels buffer pointer.
When Pixels is null, pixels are supposed to stay just after BitmapInfo structure.

Note: if ParamsEnabled = True, then the DPI is returned in Params.DpiX and Params.DpiY

Example

bmp := TIEBitmap.Create();
bmp.ParamsEnabled := True;   // So we can get the DPI
bmp.CopyFromDIB( HDib );     // Copy from HDIB passed by scanner
lblDPI.Caption := IntToStr( bmp.Params.DpiX );
ImageEnView1.IEBitmap.Assign( bmp );
bmp.Free();