Gets or sets a value indicating the current geometry frame type.
Syntax
Example
Visual Basic | Copy Code |
---|
Private Shared Sub GeometryFrameTypeExample(ByVal viewer As RasterImageViewer)
' Clean any geometry and set the frame type to none
' These are the default values
viewer.Geometry = Nothing
viewer.GeometryFrameType = GeometryFrameType.None
' Load an image into the viewer
Using codecs As New RasterCodecs()
viewer.Image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp"))
End Using
' Set a region in the image
Dim rc As New LeadRect(10, 10, viewer.Image.Width \ 3, viewer.Image.Height \ 3)
viewer.Image.AddRectangleToRegion(Nothing, rc, RasterRegionCombineMode.Set)
' By default it is not visible
MessageBox.Show("Frame: " + viewer.GeometryFrameType.ToString())
' Set it to fixed
viewer.GeometryFrameType = GeometryFrameType.Fixed
MessageBox.Show("Frame: " + viewer.GeometryFrameType.ToString())
' Finally, set it to animated
viewer.GeometryFrameType = GeometryFrameType.Animated
MessageBox.Show("Frame: " + viewer.GeometryFrameType.ToString())
End Sub
Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class |
C# | Copy Code |
---|
private static void GeometryFrameTypeExample(RasterImageViewer viewer)
{
// Clean any geometry and set the frame type to none
// These are the default values
viewer.Geometry = null;
viewer.GeometryFrameType = GeometryFrameType.None;
// Load an image into the viewer
using(RasterCodecs codecs = new RasterCodecs())
{
viewer.Image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp"));
}
// Set a region in the image
LeadRect rc = new LeadRect(10, 10, viewer.Image.Width / 3, viewer.Image.Height / 3);
viewer.Image.AddRectangleToRegion(null, rc, RasterRegionCombineMode.Set);
// By default it is not visible
MessageBox.Show("Frame: " + viewer.GeometryFrameType.ToString());
// Set it to fixed
viewer.GeometryFrameType = GeometryFrameType.Fixed;
MessageBox.Show("Frame: " + viewer.GeometryFrameType.ToString());
// Finally, set it to animated
viewer.GeometryFrameType = GeometryFrameType.Animated;
MessageBox.Show("Frame: " + viewer.GeometryFrameType.ToString());
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
} |
SilverlightCSharp | Copy Code |
---|
|
SilverlightVB | Copy Code |
---|
|
XAML | Copy Code |
---|
<Window x:Class="WPFSamples.RasterImageViewer" Height="600" Width="800" 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:RasterImageViewer Name="theViewer" Image="file:///c:\users\Public\Documents\LEADTOOLS Images\Image1.cmp" DockPanel.Dock="Bottom" HorizontalAlignment="Center" VerticalAlignment="Bottom" UseDpi="false" GeometryFrameType="Animated" />
</DockPanel>
<Window.Title>
"GeometryFrameType"
</Window.Title>
</Window> |
Remarks
Requirements
Target Platforms: Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also