DynaPDF Manual - Page 650

Previous Page 649   Index   Next Page 651

Function Reference
Page 650 of 839
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
already rendered. The update event is fired when either the UpdateOnPathCount limit was reached
or when more than 100.000 vertices were rendered, whatever occurs first. This makes sure that the
window becomes updated from time to time when very large but few paths were rendered.
UpdateOnImageCoverage limit
The member UpdateOnImageCoverage specifies a factor that is multiplied with a master area of
1,000,000 pixels. So, when the factor is set to 1.0 then the update event is fired when 1,000,000
unscaled source pixels were processed. This calculation makes sure that small images cause not too
many update events and the coverage area doesn't depend on the size of the destination image that
is rendered. The bit depth of images is also taken into account since rendering 1 bit or gray scale
images is much faster than rendering RGB or CMYK images.
In addition to the coverage limit DynaPDF counts also the number of images which were already
rendered. The update event is fired when either the coverage limit was reached or when more than
3000 images were rendered, whatever occurs first. This makes sure that the window becomes
updated from time to time when many small images were rendered.
The image scaler cannot produce an update event during scaling at this time. The event occurs
always after an image was fully scaled. This behaviour will be changed as soon as possible…
The return value
The TOnUpdateWindow callback function can break processing if necessary. The return value must
be zero to continue processing. Negative values break processing. However, the return value must
be either 0 or -1. Other return values are not permitted and can cause unwanted side effects. The
TOnUpdateWindow callback function is not the only way to break processing. When the page is
rendered in a separate thread then use the function Abort() to break processing. See next section.
 

Previous topic: The OnUpdateWindow Event

Next topic: Multi-Threading strategies