Click or drag to resize

IMcGraphOverlay2MapImageToZoomed Method

Convert image coordinates to screen coordinates in the active view.

Namespace:  MediaCy.IQL.Display.Overlays
Assembly:  MediaCy.IQL.Display.Overlays (in MediaCy.IQL.Display.Overlays.dll) Version: 10.0.6912.0
Syntax
VB
Sub MapImageToZoomed ( 
	<OutAttribute> ByRef FloatImageCoords As Object,
	<OutAttribute> ByRef LongZoomedCoords As Object,
	Optional DrawMode As mcGraphOverlayDrawMode = mcGraphOverlayDrawMode.mcgdmScreen
)

Parameters

FloatImageCoords
Type: SystemObject
Variant containing an array of coordinates to convert (one SINGLEPOINT or 2 Single values per point).
LongZoomedCoords
Type: SystemObject
Variant containing the destination array for the converted coordinates (one LONGPOINT or 2 Long values per point). Note that if this is already an array of a compatible type and long enough to hold the results, its type and length will not be changed. If the array needs to be changed, it will be returned as two Long values per result point.
DrawMode (Optional)
Type: MediaCy.IQL.Display.OverlaysmcGraphOverlayDrawMode
Conversion mode.

Implements

IMcGraphOverlayMapImageToZoomed(Object, Object, mcGraphOverlayDrawMode)
Remarks
This method will be most useful to users implementing their own tool classes (McGraphToolServer). Otherwise, since coordinates are always exposed in image coordinates, there shouldn't be any need to convert them back to screen coordinates. Use MapZoomedToImage to convert from client coordinates to unzoomed image coordinates. Note that you will not get a perfect round-trip conversion of MapImageToZoomed followed by MapZoomedToImage for Magnifications other than odd values greater than one.
Examples
VB
'This example can be pasted onto the ThisSession IQStudio Object
Private WithEvents myOvl As McGraphOverlay
Public Sub InitMappingTest()
If ThisApplication.ActiveImage Is Nothing Then
ShutDownMappingTest
Else
Set myOvl = ThisApplication.ActiveImage.AnnotationOverlay
End If
End Sub
Public Sub ShutDownMappingTest()
Set myOvl = Nothing
End Sub
Private Sub myOvl_ObjectMoved(ByVal Overlay As IMcGraphOverlay2, ByVal Object As IMcGraphObj2)
Dim fptImage As SINGLEPOINT, lptZoomed As LONGPOINT
Object.GetPosition fptImage.x, fptImage.y
Overlay.MapImageToZoomed fptImage, lptZoomed, mcgdmScreen
ThisApplication.Output.PrintMessage "Image Position: " + McToText(fptImage) + " Client Coords: " + McToText(lptZoomed)
'Round trip with output conversion of Variant
Dim varImageUnzoomed As Variant
Overlay.MapZoomedToImage lptZoomed, varImageUnzoomed, mcgdmScreen
ThisApplication.Output.PrintMessage "Image Position Unzoomed: " + McToText(varImageUnzoomed)
'Note that you will typically not get a perfect round-trip for most Magnifications
End Sub 'myOvl_ObjectMoved
See Also