Gets the physical view rectangle.
Syntax
Visual Basic (Declaration) | |
---|
Public Overridable ReadOnly Property PhysicalViewRectangle As Rect |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As BitmapSourceViewer
Dim value As Rect
value = instance.PhysicalViewRectangle
|
C# | |
---|
public virtual Rect PhysicalViewRectangle {get;} |
C++/CLI | |
---|
public:
virtual property Rect PhysicalViewRectangle {
Rect get();
} |
XAML Syntax | |
---|
You cannot set this property in XAML. |
XAML Syntax | |
---|
You cannot set this property in XAML. |
Return Value
The physical view rectangle.
Example
This example displays information about the image and the BitmapSourceViewer settings.
Visual Basic | Copy Code |
---|
Public Sub BitmapSourceViewer_ZoomToRectangle(ByVal viewer As BitmapSourceViewer)
Dim rectSize As Double = 200
Dim left As Double = (viewer.PhysicalViewRectangle.Right - viewer.PhysicalViewRectangle.Left - rectSize) / 2.0
Dim top As Double = (viewer.PhysicalViewRectangle.Bottom - viewer.PhysicalViewRectangle.Top - rectSize) / 2.0
Dim rcZoom As Rect = New Rect(left, top, rectSize, rectSize)
viewer.ZoomToRectangle(rcZoom)
End Sub |
C# | Copy Code |
---|
public void BitmapSourceViewer_ZoomToRectangle(BitmapSourceViewer viewer) { double rectSize = 200; double left = (viewer.PhysicalViewRectangle.Right - viewer.PhysicalViewRectangle.Left - rectSize) / 2.0; double top = (viewer.PhysicalViewRectangle.Bottom - viewer.PhysicalViewRectangle.Top - rectSize) / 2.0; Rect rcZoom = new Rect(left, top, rectSize, rectSize); viewer.ZoomToRectangle(rcZoom); } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family
See Also