ImageGear for .NET
ConvertCoordinates(IImGearScrollableView,ImGearPageDisplay,Graphics,ImGearCoordConvModes,Array) Method
Example 




IImGearScrollableView interface of the page view control.
PageDisplay associated with the page view control.
Graphics object used for drawing.
Translation mode, either IMAGE_TO_DEVICE or DEVICE_TO_IMAGE.
Array of ImGearPoint or ImGearDoublePoint elements to convert.
Translates coordinates between image and device coordinate systems.
Syntax
'Declaration
 
Public Overloads Sub ConvertCoordinates( _
   ByVal pageView As IImGearScrollableView, _
   ByVal pageDisplay As ImGearPageDisplay, _
   ByVal graphics As Graphics, _
   ByVal mode As ImGearCoordConvModes, _
   ByVal points As Array _
) 
'Usage
 
Dim instance As ImGearARTPage
Dim pageView As IImGearScrollableView
Dim pageDisplay As ImGearPageDisplay
Dim graphics As Graphics
Dim mode As ImGearCoordConvModes
Dim points As Array
 
instance.ConvertCoordinates(pageView, pageDisplay, graphics, mode, points)
public void ConvertCoordinates( 
   IImGearScrollableView pageView,
   ImGearPageDisplay pageDisplay,
   Graphics graphics,
   ImGearCoordConvModes mode,
   Array points
)
public: void ConvertCoordinates( 
   IImGearScrollableView* pageView,
   ImGearPageDisplay* pageDisplay,
   Graphics* graphics,
   ImGearCoordConvModes mode,
   Array* points
) 
public:
void ConvertCoordinates( 
   IImGearScrollableView^ pageView,
   ImGearPageDisplay^ pageDisplay,
   Graphics^ graphics,
   ImGearCoordConvModes mode,
   Array^ points
) 

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
// 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);
'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

Reference

ImGearARTPage Class
ImGearARTPage Members
Overload List
IImGearScrollableView Interface
IImGearPageDisplay Interface
ImGearCoordConvModes Enumeration

 

 


©2015. Accusoft Corporation. All Rights Reserved.

Send Feedback