LEADTOOLS WPF and Silverlight (Leadtools.Windows.Controls assembly)
LEAD Technologies, Inc

ZoomToRectangle Method

Example 





The rectangle to which the image should be zoomed, in client coordinates.
Zooms the image to the specified rectangle. .NET support Silverlight support
Syntax
public virtual void ZoomToRectangle( 
   Rect rc
)
'Declaration
 
Public Overridable Sub ZoomToRectangle( _
   ByVal rc As Rect _
) 
'Usage
 
Dim instance As ImageViewer
Dim rc As Rect
 
instance.ZoomToRectangle(rc)
public virtual void ZoomToRectangle( 
   Rect rc
)
 function Leadtools.Windows.Controls.ImageViewer.ZoomToRectangle( 
   rc 
)
public:
virtual void ZoomToRectangle( 
   Rect rc
) 

Parameters

rc
The rectangle to which the image should be zoomed, in client coordinates.
Remarks

The control will call this method during InteractiveMode.ZoomTo.

Example
Copy CodeCopy Code  
Public Sub BitmapSourceViewer_ZoomToRectangle(ByVal viewer As ImageViewer)
    Dim rectSize As Double = 200
    Dim left As Double = (viewer.PhysicalSize.Width - rectSize) / 2.0
    Dim top As Double = (viewer.PhysicalSize.Height - rectSize) / 2.0
    Dim rcZoom As Rect = New Rect(left, top, rectSize, rectSize)
    viewer.ZoomToRectangle(rcZoom)
End Sub
public void BitmapSourceViewer_ZoomToRectangle(ImageViewer viewer)
{
   double rectSize = 200;
   double left = (viewer.PhysicalSize.Width - rectSize) / 2.0;
   double top = (viewer.PhysicalSize.Height - rectSize) / 2.0;
   Rect rcZoom = new Rect(left, top, rectSize, rectSize);
   viewer.ZoomToRectangle(rcZoom);
}
public void BitmapSourceViewer_ZoomToRectangle(ImageViewer viewer)
{
   double rectSize = 200;
   double left = (viewer.PhysicalSize.Width - rectSize) / 2.0;
   double top = (viewer.PhysicalSize.Height - rectSize) / 2.0;
   Rect rcZoom = new Rect(left, top, rectSize, rectSize);
   viewer.ZoomToRectangle(rcZoom);
}
Public Sub BitmapSourceViewer_ZoomToRectangle(ByVal viewer As ImageViewer)
   Dim rectSize As Double = 200
   Dim left As Double = (viewer.PhysicalSize.Width - rectSize) / 2.0
   Dim top As Double = (viewer.PhysicalSize.Height - rectSize) / 2.0
   Dim rcZoom As Rect = New Rect(left, top, rectSize, rectSize)
   viewer.ZoomToRectangle(rcZoom)
End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ImageViewer Class
ImageViewer Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.