Leadtools.Windows.Controls Send comments on this topic. | Back to Introduction - LEADTOOLS WPF | Help Version 16.5.9.25
Geometry Property
See Also  Example
Leadtools.Windows.Controls Namespace > BitmapSourceViewer Class : Geometry Property





Gets or sets a Geometry value to be drawn on the BitmapSourceViewerElement. This is a dependency property.

Syntax

Visual Basic (Declaration) 
Public Property Geometry As Geometry
Visual Basic (Usage)Copy Code
Dim instance As BitmapSourceViewer
Dim value As Geometry
 
instance.Geometry = value
 
value = instance.Geometry
C# 
public Geometry Geometry {get; set;}
C++/CLI 
public:
property Geometry Geometry {
   Geometry get();
   void set (Geometry value);
}
XAML Syntax 
For XAML information, see the Geometry type.

Dependencies Property Information 

Identifier field

GeometryProperty

Metadata properties set to true

None

XAML Syntax 
For XAML information, see the Geometry type.

Dependencies Property Information 

Identifier field

GeometryProperty

Metadata properties set to true

None

Return Value

The geometry value for the BitmapSourceViewerElement. The default value is a null.

Example

This example sets a geometry for an Image and animates it.

Visual BasicCopy Code
Public Sub BitmapSourceViewer_Geometry(ByVal viewer As BitmapSourceViewer)
   viewer.BitmapEffectBehavior = BitmapEffectBehavior.ImageOnly
   viewer.Geometry = New RectangleGeometry(New Rect(0, 0, 200, 200))
   viewer.FrameGeometry = True
   viewer.AnimateGeometry = True
   viewer.BitmapEffect = New EmbossBitmapEffect()
End Sub
C#Copy Code
public void BitmapSourceViewer_Geometry(BitmapSourceViewer viewer) 

   viewer.BitmapEffectBehavior = BitmapEffectBehavior.ImageOnly; 
   viewer.Geometry = new RectangleGeometry(new Rect(0, 0, 200, 200)); 
   viewer.BitmapEffect = new EmbossBitmapEffect(); 
   viewer.FrameGeometry = true; 
   viewer.AnimateGeometry = true; 
}
XAMLCopy Code
<Window x:Class="WPFSamples.BitmapSourceViewer" Height="600" Width="800" Title="Geometry Sample" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Leadtools_Windows_Controls="clr-namespace:Leadtools.Windows.Controls;assembly=Leadtools.Windows.Controls"> 
  <DockPanel> 
    <Leadtools_Windows_Controls:BitmapSourceViewer Name="theViewer" Source="file:///C:\Program Files\LEAD Technologies\LEADTOOLS 16\Images\slave.jpg" DockPanel.Dock="Bottom" HorizontalAlignment="Center" VerticalAlignment="Bottom" BitmapEffectBehavior="ImageOnly" AnimateGeometry="True" FrameGeometry="True"> 
      <Leadtools_Windows_Controls:BitmapSourceViewer.BitmapEffect> 
        <EmbossBitmapEffect /> 
      </Leadtools_Windows_Controls:BitmapSourceViewer.BitmapEffect> 
      <Leadtools_Windows_Controls:BitmapSourceViewer.Geometry> 
        <RectangleGeometry Rect="0,0,200,200" /> 
      </Leadtools_Windows_Controls:BitmapSourceViewer.Geometry> 
    </Leadtools_Windows_Controls:BitmapSourceViewer> 
  </DockPanel> 
</Window>

Remarks

If the Geometry property is not null the BitmapEffect will be applied to this Geometry only.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family

See Also