DynaPDF Manual - Page 670

Previous Page 669   Index   Next Page 671

Function Reference
Page 670 of 860
The zoom factor should take the page format into account and not simply multiply the device
coordinates with a specific factor. The zoom factor must be restricted so that no number overflow
occurs. A suitable limit is around 32 or 64 (6400%).
The OnUpdateWindow Event
When rendering complex PDF pages in a viewer it is strongly recommended to update the window
from time to time with the portion of contents that was already rendered. To achieve this, the
structure TPDFRasterImage supports two variables which specify when the window should be
updated as well as a corresponding callback function that is executed if one of the limits were
reached.
Please note that when the TOnUpdateWindow callback function is set, it is not required to draw
the image into the window after RenderPage() was called!
When the callback function is set, RenderPage() fires at least one update event that covers the entire
imageble area. In the best case, the page was already fully rendered at this point. Calling
SetDIBitsToDevice() or similar system functions after RenderPage() is not required and causes just
unnecessary overhead!
This behaviour can be adjusted if necessary with the flags SKIP_INI_SCREEN, and
SKIP_UPDATE_SCREEN. These flags can be combined with the member StructSize of the
TPDFRasterImage structur as follows:
TPDFRasterImage img;
img.StructSize = sizeof(img) | SKIP_INIT_SCREEN | SKIP_UPDATE_SCREEN.
As the name suggessts the flag SKIP_INIT_SCREEN omits the initial screen initialisation before
rendering starts. SKIP_UPDATE_SCREEN disables the final update screen event after the page was
fully rendered.
The update area
The callback function returns the area that must be updated. It is strongly recommended to update
only this area. This can drastically speed up processing and the application can process more update
events with less overhead. The first call covers the entire imageble area when InitWhite or
DrawFrameRect was set to true. Further calls occur only when the page was not already fully
rendered at this point.
UpdateOnPathCount limit
The member UpdateOnPathCount specifies the number of paths which must be drawn before the
callback function should be executed. The value should not be too small to avoid too many update
events. When the value is too large then too few update events occur and you cannot see how the
page is drawn.
The test containers use a limit of 5000. This is a good compromise between speed and the number of
update events on faster computer systems. DynaPDF counts also the number of vertices which were
 

Previous topic: The Transformation Matrix

Next topic: UpdateOnImageCoverage limit, The return value, Multi-Threading strategies