ImageGear for .NET
ConvertCoordinates(IImGearScrollableView,ImGearPageDisplay,Graphics,ImGearCoordConvModes,Array) Method
See Also  Example Send Feedback
ImageGear21.Art Assembly > ImageGear.ART Namespace > ImGearARTPage Class > ConvertCoordinates Method : ConvertCoordinates(IImGearScrollableView,ImGearPageDisplay,Graphics,ImGearCoordConvModes,Array) Method




pageView
IImGearScrollableView interface of the page view control.
pageDisplay
PageDisplay associated with the page view control.
graphics
Graphics object used for drawing.
mode
Translation mode, either IMAGE_TO_DEVICE or DEVICE_TO_IMAGE.
points
Array of ImGearPoint or ImGearDoublePoint elements to convert.

Glossary Item Box

Translates coordinates between image and device coordinate systems.

Syntax

 
Visual Basic
C#
Managed Extensions for C++
C++/CLI
 
 

Parameters

pageView
IImGearScrollableView interface of the page view control.
pageDisplay
PageDisplay associated with the page view control.
graphics
Graphics object used for drawing.
mode
Translation mode, either IMAGE_TO_DEVICE or DEVICE_TO_IMAGE.
points
Array of ImGearPoint or ImGearDoublePoint elements to convert.

Remarks

The conversion depends on mode parameter and taks into account the annotation page orientation.

Example

C#Copy Code
// Create array for use of ConvertCoordinates method.
ImGearPoint[] igPoints = new ImGearPoint[1];
// Setup location for the point based on display coordinates,
//  often received from mouse events.
igPoints[0] = new ImGearPoint(100, 100);
// Convert point from display coordinates to image coordinates.
igARTPage.ConvertCoordinates(
    igPageView, igPageView.Display, igPageView.CreateGraphics(),
    ImGearCoordConvModes.DEVICE_TO_IMAGE, igPoints
);
// Setup color for the point.
ImGearRGBQuad igRGBQuad = new ImGearRGBQuad(0, 255, 0);
// Create the point annotation with a width of 10 and 60% opacity
ImGearARTPoint igARTPoint = new ImGearARTPoint(
    igPoints[0], igRGBQuad, 10, (int)(0.60 * 255)
);
// Add the annotation to the ARTPage.
igARTPage.AddMark(igARTPoint, ImGearARTCoordinatesType.IMAGE_COORD);
Visual BasicCopy Code
'Create array for use of ConvertCoordinates function.
Dim igPoints As ImGearPoint() = New ImGearPoint(0) {}
' Setup location for the point based on display coordinates,
'  often received from mouse events.
igPoints(0) = New ImGearPoint(100, 100)
' Convert point from display coordinates to image coordinates.
igARTPage.ConvertCoordinates(igPageView, igPageView.Display, igPageView.CreateGraphics(), _
 ImGearCoordConvModes.DEVICE_TO_IMAGE, igPoints)
' Setup color for the point.
Dim igRGBQuad As New ImGearRGBQuad(0, 255, 0)
' Create the point annotation with a width of 10 and 60% opacity
Dim igARTPoint As New ImGearARTPoint(igPoints(0), igRGBQuad, 10, CInt((0.6 * 255)))
' Add the annotation to the ARTPage.
igARTPage.AddMark(igARTPoint, ImGearARTCoordinatesType.IMAGE_COORD)

See Also

©2013. Accusoft Corporation. All Rights Reserved.