Combines the FloaterImage with the Image currently inside this RasterImageViewer.
public virtual void CombineFloater(
bool autoColorResolution,
CombineFastCommandFlags combineFlags
)
public:
virtual void CombineFloater(
bool autoColorResolution,
CombineFastCommandFlags combineFlags
)
public:
virtual void CombineFloater(
bool autoColorResolution,
CombineFastCommandFlags^ combineFlags
)
autoColorResolution
If true, automatically checks if the Leadtools.RasterImage.BitsPerPixel value of FloaterImage is different than that of Image and converts the FloaterImage prior to combining if necessary.
combineFlags
A Leadtools.ImageProcessing.CombineFastCommandFlags determining the source and destination operation used when combining the FloaterImage with the Image.
This method will use the Leadtools.ImageProcessing.CombineFastCommand image processing command to combine the FloaterImage with Image. The FloaterImage will be combined at the position specified by FloaterPosition.
If the value of autoColorResolution is set to true and FloaterImage has a different bits/pixel value of Image, this method will first use the Leadtools.ImageProcessing.ColorResolutionCommand image processing command to convert FloaterImage to the same bits/pixel of Image. If the value of autoColorResolution is false, no conversion will take place and this method might throw an exception of the bits/pixel value of the two images are not compatible.
After you call this method, you can set the value of FloaterImage to null (Nothing in VB) to dispose it.
using Leadtools.WinForms;
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Color;
using Leadtools.Drawing;
private void viewer_FloaterInteractiveModeEnded(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_FloaterInteractiveModeEnded);
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");
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document