Gets or sets the floater image.
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim instance As RasterImageViewer
Dim value As RasterImage
instance.FloaterImage = value
value = instance.FloaterImage
|
Return Value
A
RasterImage object that represents the current floater image.
Example
This sample lets you create a floater, move the floater, and combine the floater with the image.
Visual Basic | Copy Code |
---|
Private Sub viewer_InteractiveModeEnded(ByVal sender As Object, ByVal e As EventArgs)
Dim viewer As RasterImageViewer = CType(IIf(TypeOf sender Is RasterImageViewer, sender, Nothing), RasterImageViewer)
If viewer.InteractiveMode = RasterViewerInteractiveMode.Region Then
viewer.EnableTimer = True
viewer.RegionToFloater()
viewer.FloaterVisible = True
viewer.AnimateFloater = True
viewer.InteractiveMode = RasterViewerInteractiveMode.Floater
viewer.Image.MakeRegionEmpty()
MessageBox.Show("Move the floater around, double click anywhere on the viewer to combine it with the image")
End If
End Sub
Private Sub viewer_DoubleClick(ByVal sender As Object, ByVal e As EventArgs)
Dim viewer As RasterImageViewer = CType(IIf(TypeOf sender Is RasterImageViewer, sender, Nothing), RasterImageViewer)
If viewer.InteractiveMode = RasterViewerInteractiveMode.Floater Then
viewer.InteractiveMode = RasterViewerInteractiveMode.None
viewer.CombineFloater(True, ImageProcessing.CombineFastCommandFlags.SourceCopy)
viewer.FloaterImage = Nothing
MessageBox.Show("The floater has been combined with the image")
End If
End Sub
Public Sub RasterImageViewer_FloaterImage(ByVal viewer As RasterImageViewer)
AddHandler viewer.InteractiveModeEnded, AddressOf viewer_InteractiveModeEnded
AddHandler viewer.DoubleClick, AddressOf viewer_DoubleClick
viewer.InteractiveRegionType = RasterViewerInteractiveRegionType.Freehand
viewer.InteractiveRegionCombineMode = RasterRegionCombineMode.Set
viewer.InteractiveMode = RasterViewerInteractiveMode.Region
MessageBox.Show("Draw a freehand region on the image")
End Sub |
C# | Copy Code |
---|
private void viewer_InteractiveModeEnded(object sender, EventArgs e) { // an interactive mode is done. check if its drawing a region // if so, convert the region to a floater and set the interactive // mode so that we can drag the floater RasterImageViewer viewer = sender as RasterImageViewer; if (viewer.InteractiveMode == RasterViewerInteractiveMode.Region) { viewer.EnableTimer = true; viewer.RegionToFloater(); viewer.FloaterVisible = true; viewer.AnimateFloater = true; viewer.InteractiveMode = RasterViewerInteractiveMode.Floater; // delete the region since we do not need it anymore viewer.Image.MakeRegionEmpty(); MessageBox.Show("Move the floater around, double click anywhere on the viewer to combine it with the image"); } } private void viewer_DoubleClick(object sender, EventArgs e) { // check if the interactive mode is Floater, if so, // combine the floater with the image. RasterImageViewer viewer = sender as RasterImageViewer; if (viewer.InteractiveMode == RasterViewerInteractiveMode.Floater) { viewer.InteractiveMode = RasterViewerInteractiveMode.None; viewer.CombineFloater(true, ImageProcessing.CombineFastCommandFlags.SourceCopy); // get rid of the floater since we do not need it anymore viewer.FloaterImage = null; MessageBox.Show("The floater has been combined with the image"); } } public void RasterImageViewer_FloaterImage(RasterImageViewer viewer) { // hook into the viewer InteractiveModeEnded and DoubleClick events viewer.InteractiveModeEnded += new EventHandler(viewer_InteractiveModeEnded); viewer.DoubleClick += new EventHandler(viewer_DoubleClick); // first set the interactive mode to draw a freehand region viewer.InteractiveRegionType = RasterViewerInteractiveRegionType.Freehand; viewer.InteractiveRegionCombineMode = RasterRegionCombineMode.Set; viewer.InteractiveMode = RasterViewerInteractiveMode.Region; MessageBox.Show("Draw a freehand region on the image"); } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also