Shape Property

Summary

Gets or sets the Shape of the Magnifying Glass.

Syntax

C#
C++/CLI
C++
public virtual RasterMagnifyGlassShape Shape { get; set; } 
public: 
virtual property RasterMagnifyGlassShape Shape { 
   RasterMagnifyGlassShape get(); 
   void set (    RasterMagnifyGlassShape ); 
} 
public:  
   virtual property RasterMagnifyGlassShape^ Shape 
   { 
      RasterMagnifyGlassShape^ get() 
      void set(RasterMagnifyGlassShape^ value) 
   } 

Property Value

The shape of the Magnifying Glass.

Remarks

Using the Border3DStyle, the BorderWidth, the BorderColor, and the RoundRectangleEllipseSize properties depends on the value of this property.

if it set to RasterMagnifyGlassShape.None : none of the above will be used.

if it set to RasterMagnifyGlassShape.Border3D : only the Border3DStyle property will be use.

if it set to RasterMagnifyGlassShape.Rectangle or set to RasterMagnifyGlassShape.Ellipse: only the BorderWidth, and the BorderColor properties will be used.

if it set to RasterMagnifyGlassShape.RoundRectangle : the BorderWidth, the BorderColor, and the RoundRectangleEllipseSize properties will be used.

Example

C#
using Leadtools.WinForms; 
using Leadtools; 
using Leadtools.Codecs; 
 
private void magnifyGlass_CrosshairChanged(object sender, EventArgs e) 
{ 
   RasterMagnifyGlass magnifyGlass = sender as RasterMagnifyGlass; 
   Console.WriteLine("Crosshair Changed to " + magnifyGlass.Crosshair.ToString()); 
} 
 
private void magnifyGlass_CrosshairColorChanged(object sender, EventArgs e) 
{ 
   RasterMagnifyGlass magnifyGlass = sender as RasterMagnifyGlass; 
   Console.WriteLine("CrosshairColor Changed to " + magnifyGlass.CrosshairColor.ToString()); 
} 
 
private void magnifyGlass_CrosshairWidthChanged(object sender, EventArgs e) 
{ 
   RasterMagnifyGlass magnifyGlass = sender as RasterMagnifyGlass; 
   Console.WriteLine("CrosshairWidth Changed to " + magnifyGlass.CrosshairWidth.ToString()); 
} 
 
private void magnifyGlass_Border3DStyleChanged(object sender, EventArgs e) 
{ 
   RasterMagnifyGlass magnifyGlass = sender as RasterMagnifyGlass; 
   Console.WriteLine("Border3DStyle Changed to " + magnifyGlass.Border3DStyle.ToString()); 
} 
 
private void magnifyGlass_BorderColorChanged(object sender, EventArgs e) 
{ 
   RasterMagnifyGlass magnifyGlass = sender as RasterMagnifyGlass; 
   Console.WriteLine("BorderColor Changed to " + magnifyGlass.BorderColor.ToString()); 
} 
 
private void magnifyGlass_BorderWidthChanged(object sender, EventArgs e) 
{ 
   RasterMagnifyGlass magnifyGlass = sender as RasterMagnifyGlass; 
   Console.WriteLine("BorderWidth Changed to " + magnifyGlass.BorderWidth.ToString()); 
} 
 
private void magnifyGlass_ShapeChanged(object sender, EventArgs e) 
{ 
   RasterMagnifyGlass magnifyGlass = sender as RasterMagnifyGlass; 
   Console.WriteLine("Shape Changed to " + magnifyGlass.Shape.ToString()); 
} 
 
private void magnifyGlass_SizeChanged(object sender, EventArgs e) 
{ 
   RasterMagnifyGlass magnifyGlass = sender as RasterMagnifyGlass; 
   Console.WriteLine("Size Changed to " + magnifyGlass.Size.ToString()); 
} 
 
private void magnifyGlass_ScaleFactorChanged(object sender, EventArgs e) 
{ 
   RasterMagnifyGlass magnifyGlass = sender as RasterMagnifyGlass; 
   Console.WriteLine("Scale Factor Changed to " + magnifyGlass.ScaleFactor.ToString()); 
} 
 
private void magnifyGlass_RoundRectangleEllipseSizeChanged(object sender, EventArgs e) 
{ 
   RasterMagnifyGlass magnifyGlass = sender as RasterMagnifyGlass; 
   Console.WriteLine("RoundRectangleEllipseSize Changed to " + magnifyGlass.RoundRectangleEllipseSize.ToString()); 
} 
 
public void RasterMagnifyGlass_Border3DStyle(RasterImageViewer viewer) 
{ 
   viewer.InteractiveMode = RasterViewerInteractiveMode.MagnifyGlass; 
   viewer.MagnifyGlass.CrosshairChanged += new EventHandler(magnifyGlass_CrosshairChanged); 
   viewer.MagnifyGlass.CrosshairColorChanged += new EventHandler(magnifyGlass_CrosshairColorChanged); 
   viewer.MagnifyGlass.CrosshairWidthChanged += new EventHandler(magnifyGlass_CrosshairWidthChanged); 
   viewer.MagnifyGlass.Border3DStyleChanged += new EventHandler(magnifyGlass_Border3DStyleChanged); 
   viewer.MagnifyGlass.BorderColorChanged += new EventHandler(magnifyGlass_BorderColorChanged); 
   viewer.MagnifyGlass.BorderWidthChanged += new EventHandler(magnifyGlass_BorderWidthChanged); 
   viewer.MagnifyGlass.ShapeChanged += new EventHandler(magnifyGlass_ShapeChanged); 
   viewer.MagnifyGlass.SizeChanged += new EventHandler(magnifyGlass_SizeChanged); 
   viewer.MagnifyGlass.ScaleFactorChanged += new EventHandler(magnifyGlass_ScaleFactorChanged); 
   viewer.MagnifyGlass.RoundRectangleEllipseSizeChanged += new EventHandler(magnifyGlass_RoundRectangleEllipseSizeChanged); 
 
   if (viewer.MagnifyGlass.Shape != RasterMagnifyGlassShape.Border3D) 
   { 
      // Set the crosshair style 
      viewer.MagnifyGlass.Shape = RasterMagnifyGlassShape.Border3D; 
      viewer.MagnifyGlass.Border3DStyle = Border3DStyle.Sunken; 
 
      // Now change to a different shape 
      viewer.MagnifyGlass.Shape = RasterMagnifyGlassShape.RoundRectangle; 
      viewer.MagnifyGlass.RoundRectangleEllipseSize = new Size(15, 15); 
      viewer.MagnifyGlass.BorderColor = Color.DarkBlue; 
      viewer.MagnifyGlass.BorderWidth = 10; 
      viewer.MagnifyGlass.Crosshair = RasterMagnifyGlassCrosshair.Fine; 
      viewer.MagnifyGlass.CrosshairColor = Color.Red; 
      viewer.MagnifyGlass.CrosshairWidth = 5; 
      viewer.MagnifyGlass.Size = new Size(200, 100); 
      viewer.MagnifyGlass.ScaleFactor = 1.5f; 
   } 
 
   viewer.MagnifyGlass.CrosshairChanged -= new EventHandler(magnifyGlass_CrosshairChanged); 
   viewer.MagnifyGlass.CrosshairColorChanged -= new EventHandler(magnifyGlass_CrosshairColorChanged); 
   viewer.MagnifyGlass.CrosshairWidthChanged -= new EventHandler(magnifyGlass_CrosshairWidthChanged); 
   viewer.MagnifyGlass.Border3DStyleChanged -= new EventHandler(magnifyGlass_Border3DStyleChanged); 
   viewer.MagnifyGlass.BorderColorChanged -= new EventHandler(magnifyGlass_BorderColorChanged); 
   viewer.MagnifyGlass.BorderWidthChanged -= new EventHandler(magnifyGlass_BorderWidthChanged); 
   viewer.MagnifyGlass.ShapeChanged -= new EventHandler(magnifyGlass_ShapeChanged); 
   viewer.MagnifyGlass.SizeChanged -= new EventHandler(magnifyGlass_SizeChanged); 
   viewer.MagnifyGlass.ScaleFactorChanged -= new EventHandler(magnifyGlass_ScaleFactorChanged); 
   viewer.MagnifyGlass.RoundRectangleEllipseSizeChanged -= new EventHandler(magnifyGlass_RoundRectangleEllipseSizeChanged); 
 
} 

Requirements

Target Platforms

See Also

Reference

RasterMagnifyGlass Class

RasterMagnifyGlass Members

Help Version 22.0.2023.2.9
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.WinForms Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.