Gets or sets the RasterMagnifyGlass object used to perform Magnifying Glass operations for this RasterImageViewer.
public virtual RasterMagnifyGlass MagnifyGlass { get; set; }
[BrowsableAttribute(false)]
public:
virtual property RasterMagnifyGlass^ MagnifyGlass {
RasterMagnifyGlass^ get();
void set ( RasterMagnifyGlass^ );
}
public:
virtual property RasterMagnifyGlass^ MagnifyGlass
{
RasterMagnifyGlass^ get()
void set(RasterMagnifyGlass^ value)
}
The RasterMagnifyGlass object used to perform Magnifying Glass operations for this RasterImageViewer.
Use the AutoInteractiveMagnifyGlass property to control whether the magnifying glass only appears when the current interactive button is down.
You can derive your own class from RasterMagnifyGlass, and then set this property to an instance of that class to perform your own Magnifying Glass processing (for example, change the way the crosshair is displayed).
This sample lets create your own custom magnify glass. The custom magnify glass is drawn with a red "X" for the crosshair The border is a blue rectangle.
using Leadtools.WinForms;
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Color;
using Leadtools.Drawing;
class MyRasterMagnifyGlass : RasterMagnifyGlass
{
public MyRasterMagnifyGlass()
{
Shape = RasterMagnifyGlassShape.Border3D;
}
protected override void OnPaintBorder(Graphics graphics, Point centerPoint)
{
int width = (Size.Width - 2) / 2;
int height = (Size.Height - 2) / 2;
Rectangle rc = new Rectangle(centerPoint.X - width, centerPoint.Y - height, 2 * width, 2 * height);
graphics.DrawRectangle(Pens.Blue, rc);
}
protected override void OnPaintCrosshair(Graphics graphics, Point centerPoint)
{
int width = (Size.Width - 2) / 2;
int height = (Size.Height - 2) / 2;
Point p1 = new Point(centerPoint.X - width, centerPoint.Y - height);
Point p2 = new Point(centerPoint.X + width, centerPoint.Y + height);
graphics.DrawLine(Pens.Red, p1, p2);
p1 = new Point(centerPoint.X + width, centerPoint.Y - height);
p2 = new Point(centerPoint.X - width, centerPoint.Y + height);
graphics.DrawLine(Pens.Red, p1, p2);
}
}
private void viewer_MagnifyGlassChanged(object sender, EventArgs e)
{
MessageBox.Show("Custom Magnify Glass being used -- red X for crosshair, blue for border");
}
public void RasterImageViewer_MagnifyGlass(RasterImageViewer viewer)
{
viewer.MagnifyGlassChanged += new EventHandler(viewer_MagnifyGlassChanged);
viewer.MagnifyGlass = new MyRasterMagnifyGlass();
viewer.InteractiveMode = RasterViewerInteractiveMode.MagnifyGlass;
viewer.MagnifyGlassChanged -= new EventHandler(viewer_MagnifyGlassChanged);
}
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