Translates a point (x,y) from this
RasterImage view perspective to the specified view perspective.
Syntax
Parameters
- viewPerspective
- Destination view perspective to which the point should be translated.
- pt
- The point to translate.
Return Value
The translated point.
Example
This example finds out where the origin of the image would be. Then it converts a known point to bitmap coordinates.
Visual Basic |
Copy Code |
Public Sub PointFromImageExample() RasterCodecs.Startup() Dim codecs As RasterCodecs = New RasterCodecs() Dim image As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "ULAY1.BMP")
Dim ImagePoint As Point = New Point(0, 0) ImagePoint = image.PointFromImage(RasterViewPerspective.TopLeft, ImagePoint) Console.WriteLine(String.Format("{0},{1}", ImagePoint.X, ImagePoint.Y))
ImagePoint.X = 0 ImagePoint.Y = 0 ImagePoint = image.PointToImage(RasterViewPerspective.TopLeft, ImagePoint) Console.WriteLine(String.Format("{0},{1}", ImagePoint.X, ImagePoint.Y))
image.Dispose() codecs.Dispose() RasterCodecs.Shutdown() End Sub |
C# |
Copy Code |
public void PointFromImageExample() { RasterCodecs.Startup(); RasterCodecs codecs = new RasterCodecs(); // Load an image that has BottomLeft ViewPerspective RasterImage image = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "ULAY1.BMP"); Point ImagePoint = new Point(0, 0); ImagePoint = image.PointFromImage(RasterViewPerspective.TopLeft, ImagePoint); Console.WriteLine(string.Format("{0},{1}", ImagePoint.X, ImagePoint.Y)); ImagePoint.X = 0; ImagePoint.Y = 0; ImagePoint = image.PointToImage(RasterViewPerspective.TopLeft, ImagePoint); Console.WriteLine(string.Format("{0},{1}", ImagePoint.X, ImagePoint.Y)); image.Dispose(); codecs.Dispose(); RasterCodecs.Shutdown(); } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also