MakeBitmap Method


Applies to

THtmlViewer component

Declaration

function MakeBitmap(YTop, FormatWidth, Width, Height: integer): TBitmap;

Description

The MakeBitmap method produces a bitmap of a portion of the document currently loaded.

YTopThe top of the bitmap in pixels. 0 would be the start of the document.

FormatWidthThe width to which the HTML is to be formatted. Text would typically wrap at this width.

WidthThe width of the bitmap. This might be greater than FormatWidth.

HeightThe height of the bitmap.

Usage Notes

The bitmaps generated can be very large. Currently, the maximum Height allowed is 4000 pixels so some sort of paging is required for large documents.

Before calling MakeBitmap, use the FullDisplaySize method to ascertain the overall formatted size so that the MakeBitmap parameters can be properly set. The Width returned by FullDisplaySize may exceed FormatWidth if the contents can't be successfully wrapped. This Width should be used to specify the bitmap width. Alternatively, FormatWidth may be set to this Width and FullDisplaySize called again to obtain the new Height.

To make a series of bitmaps that can be pieced together, use values for YTop of 0, Height, 2*Height, etc.

See Also:

FullDisplaySize Method

MakeMetafile Method