Click or drag to resize

ImageViewOnBeforeZoneCustomDrawing Event

This event is fired when the EnableCustomDrawing and ZonesVisible properties are True, and the control is about to paint one of the zones.

Namespace:  Kofax.OmniPageCSDK.ToolBoxes
Assembly:  Kofax.OmniPageCSDK.ToolBoxes (in Kofax.OmniPageCSDK.ToolBoxes.dll) Version: 1.0.0.0
Syntax
public event ImageViewBeforeZoneCustomDrawingHandler OnBeforeZoneCustomDrawing

Value

Type: Kofax.OmniPageCSDK.ToolBoxesImageViewBeforeZoneCustomDrawingHandler
Remarks

This event allows you to override or modify the default zone drawing implementation. ZoneIndex identifies the zone being drawn according to the current IproPlus UserZones collection position. The Rects parameter holds an array of IPRORECT structures defining the currently drawn zone layout. For simple, rectangular zones this array has only a single item containing the bounding rectangle. For more complicated, irregular zones the array has a number of non-intersecting rectangles whose union covers the zone surface being painted. If the Active parameter is true, the zone being painted is the active one. If Selected is True, then the zone being painted is one of the selected zones. DC contains the memory HDC which you can use to perform painting.

The items in the Rects array hold View coordinates. Because the DC parameter is also assigned to the View coordinate system, the IPRORECT structures are already mapped and scaled accordingly. You do not need to perform any coordinate transformation prior to calling the GDI functions you use for custom painting. To learn more about the ImageView coordinate systems and the usage of this event, refer to the Coordinate Systems chapter in the documentation.

If the CancelDefaultDrawing parameter is set to False (or the event is not handled), the default implementation will run and your painting will be overwritten. Consequently, if you only want to perform some additional drawing over the default zone painting implementation, use the AfterZoneCustomDrawing event instead. If this parameter is set to True, the ImageView will not draw this zone at all. In this case the integrator is responsible to take care of painting the control content either in BeforeZoneCustomDrawing or AfterZoneCustomDrawing.

See Also