ImageEn, unit iexUserInteractions

TIEPdfViewerInteraction.DrawTo

TIEPdfViewerInteraction.DrawTo


Declaration

procedure DrawTo(Bitmap: TIEBitmap; Width: Integer = -1; Height: Integer = -1; MaintainAR: Boolean = True); overload;
procedure DrawTo(Bitmap: TBitmap; Width: Integer = -1; Height: Integer = -1; MaintainAR: Boolean = True); overload;
procedure DrawTo(Canvas: TCanvas; Width: Integer = -1; Height: Integer = -1; MaintainAR: Boolean = True); overload;


Description

Output the current page to an image or canvas.
You can optionally specify the draw size using Width and Height. To maintain the image aspect ratio set only one size, assigning -1 to the other, e.g. DrawTo( bmp, -1, 500); or set both values and enable MaintainAR.

Note: The size of the PDF page as displayed on-screen and when output to bitmap is controlled by IEGlobalSettings().PdfViewerDefaults.DPI


Examples

// Add current page to another TImageEnView
ImageEnView1.PdfViewer.DrawTo( ImageEnView2.IEBitmap );
ImageEnView2.Update();

// Save current page to JPEG at height of 1000 pixels, where width is auto-calculated
bmp := TIEBitmap.Create;
ImageEnView1.PdfViewer.DrawTo( bmp, -1, 1000 );
bmp.Write('D:\page.jpeg');
bmp.Free;

// Fill a TImage with the current page (without maintain the aspect ratio
ImageEnView1.PdfViewer.DrawTo( Image1.Picture.Bitmap, Image1.Width, Image1.Height, False );

// Add current page to a TImageEnMView
idx := ImageEnMView1.AppendImage( 0,0,ie24RGB );
bmp := ImageEnMView1.GetTIEBitmap( idx );
ImageEnView1.PdfViewer.DrawTo( bmp );
ImageEnMView1.ReleaseBitmap( idx, True );


See Also

- SyncToBitmap