- Start Visual Studio .NET.
- Leadtools.dll
Property | Value |
Dock | Fill |
[Visual Basic]
Imports Leadtools Imports Leadtools.Codecs Imports Leadtools.WinForms[C#]
using Leadtools; using Leadtools.Codecs; using Leadtools.WinForms;Add an event handler to the Form1 Load event and add the following code:
[Visual Basic]
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Load an image into the viewer Dim codecs As New RasterCodecs rasterImageViewer1.Image = codecs.Load("C:\Users\Public\Documents\LEADTOOLS Images\Image2.cmp") ' Use an elliptical magnifying glass with a thick green cross rasterImageViewer1.InteractiveMode = RasterViewerInteractiveMode.MagnifyGlass rasterImageViewer1.MagnifyGlass.Size = New Size(180, 180) rasterImageViewer1.MagnifyGlass.BorderColor = Color.Red rasterImageViewer1.MagnifyGlass.BorderWidth = 2 rasterImageViewer1.MagnifyGlass.Crosshair = RasterMagnifyGlassCrosshair.Fine rasterImageViewer1.MagnifyGlass.CrosshairColor = Color.Green rasterImageViewer1.MagnifyGlass.CrosshairWidth = 3 rasterImageViewer1.MagnifyGlass.RoundRectangleEllipseSize = New Size(20, 20) rasterImageViewer1.MagnifyGlass.ScaleFactor = 4 rasterImageViewer1.MagnifyGlass.Shape = RasterMagnifyGlassShape.Ellipse rasterImageViewer1.Show() Text = "Click and drag on the image to see the MagnifyGlass" End Sub[C#]
private void Form1_Load(object sender, System.EventArgs e) { // Load an image into the viewer RasterCodecs codecs = new RasterCodecs(); rasterImageViewer1.Image = codecs.Load(@"C:\Users\Public\Documents\LEADTOOLS Images\Image2.cmp"); // Use an elliptical magnifying glass with a thick green cross rasterImageViewer1.InteractiveMode = RasterViewerInteractiveMode.MagnifyGlass; rasterImageViewer1.MagnifyGlass.Size = new Size(180, 180); rasterImageViewer1.MagnifyGlass.BorderColor = Color.Red; rasterImageViewer1.MagnifyGlass.BorderWidth = 2; rasterImageViewer1.MagnifyGlass.Crosshair = RasterMagnifyGlassCrosshair.Fine; rasterImageViewer1.MagnifyGlass.CrosshairColor = Color.Green; rasterImageViewer1.MagnifyGlass.CrosshairWidth = 3; rasterImageViewer1.MagnifyGlass.RoundRectangleEllipseSize = new Size(20, 20); rasterImageViewer1.MagnifyGlass.ScaleFactor = 4; rasterImageViewer1.MagnifyGlass.Shape = RasterMagnifyGlassShape.Ellipse; rasterImageViewer1.Show(); Text = "Click and drag on the image to see the MagnifyGlass"; }Build, and Run the program to test it.