示例#1
0
        /// <summary>
        /// Display or not the MagnifyGlass border as 3D
        /// </summary>


        /// <summary>
        /// Change the MagnifyGlass crosshair style
        /// </summary>
        private void _miOptionsCrosshair_Click(object sender, System.EventArgs e)
        {
            if (sender == _miOptionsCrosshairNone)
            {
                _crosshair = ImageViewerSpyGlassCrosshair.None;
            }
            else
            {
                _crosshair = ImageViewerSpyGlassCrosshair.Fine;
            }

            UpdateMyControls();
        }
示例#2
0
        private void MainForm_Load(object sender, System.EventArgs e)
        {
            // setup our caption
            Messager.Caption = "LEADTOOLS for .NET C# MagnifyGlass Demo";
            Text             = Messager.Caption;

            // initialize the _viewer object
            _viewer = new ImageViewer();

            // Add the MagnifyGlass InteractiveMode
            _viewer.InteractiveModes.Add(magGlass);

            RasterPaintProperties paintProperties = RasterPaintProperties.Default;

            paintProperties.PaintDisplayMode |= RasterPaintDisplayModeFlags.Bicubic | RasterPaintDisplayModeFlags.ScaleToGray;
            paintProperties.PaintEngine       = RasterPaintEngine.GdiPlus;
            _viewer.PaintProperties           = paintProperties;
            _viewer.Dock      = DockStyle.Fill;
            _viewer.BackColor = Color.DarkGray;
            Controls.Add(_viewer);
            _viewer.BringToFront();

            // initialize the codecs object
            _codecs = new RasterCodecs();

            // initialize the other variables
            _borderColor               = Color.Red;
            _borderWidth               = 2;
            _crosshair                 = ImageViewerSpyGlassCrosshair.Fine;
            _crosshairColor            = Color.Green;
            _crosshairWidth            = 1;
            _roundRectangleEllipseSize = new LeadSize(20, 20);
            _scaleFactor               = 2;
            _shape = ImageViewerSpyGlassShape.Rectangle;
            _size  = new LeadSize(150, 150);

            UpdateMyControls();
        }