Several of the LEADTOOLS methods and classes for creating and working with a region use coordinates from an external representation of the region, such as a shape drawn in a device context.
To compensate for possible differences in view perspective, scaling, and display offsets, these LEADTOOLS methods or classes require that you provide translation information in a RasterRegionXForm class. (For details on how information is translated, refer to the structure description.)
In most cases, the external representation of a region is scaled and positioned relative to the display coordinates of a LEADTOOLS painting method. Therefore, the following table describes the fields to set in the RasterRegionXForm class, based on the parameters of the Paint method:
Property |
Description |
---|---|
The view perspective of the external representation. With LEADTOOLS painting methods, the view perspective is always TopLeft. |
|
The numerator for the X scaling factor. |
|
When translating information from the image, you can use the width of the painting method's destination rectangle for this value. Methods that translate in this direction are FrameRegion, GetRegionBounds, and GetGdiRegionData |
|
When translating information to the image, you can use the width of the painting method's source rectangle for this value. (By default, it is the image width.) Methods that translate in this direction are AddEllipseToRegion, AddGdiDataToRegion, AddPolygonToRegion, AddRectangleToRegion, and AddRoundRectangleToRegion. |
|
The denominator for the X scaling factor. |
|
When translating information from the image, you can use the width of the painting method's source rectangle for this value. (By default, it is the image width.) |
|
When translating information to the image, you can use the width of the painting method's destination rectangle for this value. |
|
Refer to the XScalarNumerator property to see which methods translate which direction. |
|
The numerator for the Y scaling factor. |
|
When translating information from the image, you can use the height of the painting method's destination rectangle for this value. |
|
When translating information to the image, you can use the height of the painting method's source rectangle for this value. (By default, it is the image height.) |
|
Refer to the XScalarNumerator property to see which methods translate which direction. |
|
The denominator for the Y scaling factor. |
|
When translating information from the image, you can use the height of the painting method's source rectangle for this value. (By default, it is the image height.) |
|
When translating information to the image, you can use the height of the painting method's destination rectangle for this value. |
|
Refer to the XScalarNumerator property to see which methods translate which direction. |
|
The X offset of the external representation. |
|
When translating information from the image, you can use the left value of the painting method's destination rectangle. |
|
When translating information to the image, you can negate the left value of the painting method's destination rectangle (-left). |
|
Refer to the XScalarNumerator property to see which methods translate which direction. |
|
The Y offset of the external representation. |
|
When translating information from the image, you can use the top value of the painting method's destination rectangle. |
|
When translating information to the image, you can negate the top value of the painting method's destination rectangle (-top). |
|
Refer to the XScalarNumerator property to see which methods translate which direction. |
All region methods accept a NULL pointer for this structure. In that case, no transformation occurs. The scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the image's view perspective.
Related topics:
Products |
Support |
Feedback: Translating Coordinates for a Region |
Introduction |
Help Version 19.0.2017.6.21
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.