Gets or sets the position of the floater.
[DescriptionAttribute("Gets or sets the position of the floater.")]
[CategoryAttribute("Floater and Region")]
public virtual Point FloaterPosition {get; set;}
<DescriptionAttribute("Gets or sets the position of the floater.")>
<CategoryAttribute("Floater and Region")>
Public Overridable Property FloaterPosition As Point
[DescriptionAttribute("Gets or sets the position of the floater.")]
[CategoryAttribute("Floater and Region")]
public:
virtual property Point FloaterPosition {
Point get();
void set ( Point );
}
A System.Drawing.Point object that represents the top-left position used when painting the FloaterImage.
You can manually set the value of this property to control where the FloaterImage is painted.
When the InteractiveMode of this RasterImageVieweris set to RasterViewerInteractiveMode.Floater, the viewer will update the value of this property as the user drags the FloaterImage around.
This sample creates a floater and lets the user move it.
Imports Leadtools.WinForms
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.Color
Imports Leadtools.Drawing
Private Sub viewer_InteractiveFloater(ByVal sender As Object, ByVal e As RasterViewerPointEventArgs)
' show information about the user interaction
Dim viewer As RasterImageViewer = CType(IIf(TypeOf sender Is RasterImageViewer, sender, Nothing), RasterImageViewer)
Console.WriteLine("Status: {0}, Canceled: {1}, Point: {2}, Floater Position: {3}", e.Status, e.Cancel, e.Point, viewer.FloaterPosition)
End Sub
Public Sub RasterImageViewer_FloaterPosition(ByVal viewer As RasterImageViewer)
' hook into the viewer InteractiveFloater event to get updated whenever the user moves the floater.
AddHandler viewer.InteractiveFloater, AddressOf viewer_InteractiveFloater
' add a floater the viewer and start the floater interactive mode
' we are going to create the floater image manually as a red ellipse with a region.
Dim palette As RasterColor() = New RasterColor() {}
Dim floaterImage As RasterImage = New RasterImage(RasterMemoryFlags.Conventional, 200, 200, 24, RasterByteOrder.Bgr, _
RasterViewPerspective.TopLeft, palette, IntPtr.Zero, 0)
Dim container As RasterImageGdiPlusGraphicsContainer = New RasterImageGdiPlusGraphicsContainer(floaterImage)
Try
container.Graphics.FillRectangle(Brushes.Black, 0, 0, floaterImage.ImageWidth, floaterImage.ImageHeight)
container.Graphics.FillEllipse(Brushes.Red, 0, 0, floaterImage.ImageWidth, floaterImage.ImageHeight)
Finally
CType(container, IDisposable).Dispose()
End Try
floaterImage.AddColorToRegion(RasterColor.FromKnownColor(RasterKnownColor.Red), RasterRegionCombineMode.Set)
viewer.FloaterImage = floaterImage
viewer.FloaterVisible = True
viewer.FloaterPosition = New Point(100, 100)
viewer.InteractiveMode = RasterViewerInteractiveMode.Floater
MessageBox.Show("Click and move the floater")
End Sub
using Leadtools.WinForms;
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Color;
using Leadtools.Drawing;
private void viewer_InteractiveFloater(object sender, RasterViewerPointEventArgs e)
{
// show information about the user interaction
RasterImageViewer viewer = sender as RasterImageViewer;
Console.WriteLine("Status: {0}, Canceled: {1}, Point: {2}, Floater Position: {3}", e.Status, e.Cancel, e.Point, viewer.FloaterPosition);
}
public void RasterImageViewer_FloaterPosition(RasterImageViewer viewer)
{
// hook into the viewer InteractiveFloater event to get updated whenever the user moves the floater.
viewer.InteractiveFloater += new EventHandler<RasterViewerPointEventArgs>(viewer_InteractiveFloater);
// add a floater the viewer and start the floater interactive mode
// we are going to create the floater image manually as a red ellipse with a region.
RasterColor[]palette = new RasterColor[0];
RasterImage floaterImage = new RasterImage(
RasterMemoryFlags.Conventional,
200,
200,
24,
RasterByteOrder.Bgr,
RasterViewPerspective.TopLeft,
palette,
IntPtr.Zero,
0
);
using (RasterImageGdiPlusGraphicsContainer container = new RasterImageGdiPlusGraphicsContainer(floaterImage))
{
container.Graphics.FillRectangle(Brushes.Black, 0, 0, floaterImage.ImageWidth, floaterImage.ImageHeight);
container.Graphics.FillEllipse(Brushes.Red, 0, 0, floaterImage.ImageWidth, floaterImage.ImageHeight);
}
floaterImage.AddColorToRegion(RasterColor.FromKnownColor(RasterKnownColor.Red), RasterRegionCombineMode.Set);
viewer.FloaterImage = floaterImage;
viewer.FloaterVisible = true;
viewer.FloaterPosition = new Point(100, 100);
viewer.InteractiveMode = RasterViewerInteractiveMode.Floater;
MessageBox.Show("Click and move the floater");
}
Products |
Support |
Feedback: FloaterPosition Property - Leadtools.WinForms |
Introduction |
Help Version 19.0.2017.3.22
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.