Drawing Pages and Zones
LEADTOOLS provides methods for drawing pages, with or without zones. The zones may or may not be selected.
Before drawing a page, that page must be set as "active" by setting the ActivePageIndex property. Once the active page has been set, call the DrawPage method to draw the active page. The value of the EnableShowZones property determines whether the zones will be drawn with the page. The DrawPage method will draw the page either on the raster object passed to it or on the HDC, based on the value of the DrawPersistence property.
A page may be drawn "zoomed in" by setting a paint zoom factor before actually drawing the page. To set the paint zoom factor for a specific page, set the PaintZoomFactor property for that page.
When using the DrawPage method, the height and width of both the source page and the destination page, as well as the areas that are actually painted can be controlled using the following properties:
DestinationClipHeight property
The unit or measure for these "source" and "destination" properties is determined by the ScaleMode property.
A zone can be selected and drawn in the HDC using the SelectZone method or the SelectZoneByPoint method. The SelectZone selects or deselects a zone by specifying a page index and a zone index. If the zone is selected, the zone is drawn with a "selection rectangle" around it.
The SelectZoneByPoint selects a zone by determining which zone on the page contains the specified point. If a zone containing that point is found, that zone is selected and the zone is redrawn with a "selection rectangle" around it. The SelectedZone property and the SelectZoneIndex property are also updated with information on the zone located at the specified point.
To set the pen used to draw the zones, set the ZonePenColor property, the ZonePenStyle property, and the ZonePenWidth property to the desired values and call the SetZonePen method. To set the pen used to draw the selected zones, set the SelectedZonePenColor property, the SelectedZonePenStyle property, and the SelectedZonePenWidth property to the desired values and call the SetSelectedZonePen method.
To update the area of a specific zone on a specific page, call the UpdateZoneArea method.
The RemoveSelectedZone method removes the selected zone from the zone list of the specified page.