TPanelPrintEvent = procedure(Sender: TObject; Panel: ThvPanel; const Bitmap: TBitmap) of Object;
The TPanelPrintEvent type is the type for the OnPanelPrint event. This event occurs when a PANEL tag is encountered when the document is printed.
Sender is the THtmlViewer displaying the ThvPanel.
Panel is the ThvPanel (similar to TPanel) created for the display.
Bitmap is the bitmap that will be printed for the panel. The event handler should draw the desired results on the bitmap's canvas.
Example:
The following event handler is satisfactory for panels constructed with VCL controls:
procedure TForm1.ViewerPanelPrint(Sender: TObject; Panel: ThvPanel; const Bitmap: TBitmap);
begin
Bitmap.Canvas.Lock;
Panel.PaintTo(Bitmap.Canvas, 0, 0);
Bitmap.Canvas.Unlock;
end;
See also: