Click here to Skip to main content
15,896,063 members
Articles / Multimedia / GDI+

Image Magnifier Control

Rate me:
Please Sign up or sign in to vote.
4.45/5 (5 votes)
11 Oct 2006CPOL2 min read 58.4K   2.4K   22  
ImageMagnifier - a simple control for image zooming.
namespace Demo_ImageMagnifier
{
    partial class frmMain
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
            this.chbZoom = new System.Windows.Forms.CheckBox();
            this.btnLoadImg = new System.Windows.Forms.Button();
            this.originalImage = new System.Windows.Forms.PictureBox();
            this.lblMagnificationCoefficient = new System.Windows.Forms.Label();
            this.nudMagnificationCoefficient = new System.Windows.Forms.NumericUpDown();
            this.magnifiedImage = new ImageMagnifier.ImageMagnifier();
            this.splitContainer1.Panel1.SuspendLayout();
            this.splitContainer1.Panel2.SuspendLayout();
            this.splitContainer1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.originalImage)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.nudMagnificationCoefficient)).BeginInit();
            this.SuspendLayout();
            // 
            // splitContainer1
            // 
            this.splitContainer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.splitContainer1.Location = new System.Drawing.Point(0, 0);
            this.splitContainer1.Name = "splitContainer1";
            // 
            // splitContainer1.Panel1
            // 
            this.splitContainer1.Panel1.Controls.Add(this.chbZoom);
            this.splitContainer1.Panel1.Controls.Add(this.btnLoadImg);
            this.splitContainer1.Panel1.Controls.Add(this.originalImage);
            // 
            // splitContainer1.Panel2
            // 
            this.splitContainer1.Panel2.Controls.Add(this.lblMagnificationCoefficient);
            this.splitContainer1.Panel2.Controls.Add(this.nudMagnificationCoefficient);
            this.splitContainer1.Panel2.Controls.Add(this.magnifiedImage);
            this.splitContainer1.Size = new System.Drawing.Size(475, 314);
            this.splitContainer1.SplitterDistance = 233;
            this.splitContainer1.TabIndex = 0;
            // 
            // chbZoom
            // 
            this.chbZoom.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
            this.chbZoom.AutoSize = true;
            this.chbZoom.Location = new System.Drawing.Point(160, 290);
            this.chbZoom.Name = "chbZoom";
            this.chbZoom.Size = new System.Drawing.Size(53, 17);
            this.chbZoom.TabIndex = 2;
            this.chbZoom.Text = "Zoom";
            this.chbZoom.UseVisualStyleBackColor = true;
            this.chbZoom.CheckedChanged += new System.EventHandler(this.chbZoom_CheckedChanged);
            // 
            // btnLoadImg
            // 
            this.btnLoadImg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.btnLoadImg.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.btnLoadImg.Location = new System.Drawing.Point(3, 286);
            this.btnLoadImg.Name = "btnLoadImg";
            this.btnLoadImg.Size = new System.Drawing.Size(135, 23);
            this.btnLoadImg.TabIndex = 1;
            this.btnLoadImg.Text = "Load image from file...";
            this.btnLoadImg.UseVisualStyleBackColor = true;
            this.btnLoadImg.Click += new System.EventHandler(this.btnLoadImg_Click);
            // 
            // originalImage
            // 
            this.originalImage.Dock = System.Windows.Forms.DockStyle.Top;
            this.originalImage.Location = new System.Drawing.Point(0, 0);
            this.originalImage.Name = "originalImage";
            this.originalImage.Size = new System.Drawing.Size(231, 277);
            this.originalImage.TabIndex = 0;
            this.originalImage.TabStop = false;
            // 
            // lblMagnificationCoefficient
            // 
            this.lblMagnificationCoefficient.AutoSize = true;
            this.lblMagnificationCoefficient.Location = new System.Drawing.Point(33, 290);
            this.lblMagnificationCoefficient.Name = "lblMagnificationCoefficient";
            this.lblMagnificationCoefficient.Size = new System.Drawing.Size(120, 13);
            this.lblMagnificationCoefficient.TabIndex = 2;
            this.lblMagnificationCoefficient.Text = "Mgnification Coefficient:";
            // 
            // nudMagnificationCoefficient
            // 
            this.nudMagnificationCoefficient.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.nudMagnificationCoefficient.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.nudMagnificationCoefficient.Location = new System.Drawing.Point(159, 286);
            this.nudMagnificationCoefficient.Maximum = new decimal(new int[] {
            64,
            0,
            0,
            0});
            this.nudMagnificationCoefficient.Minimum = new decimal(new int[] {
            1,
            0,
            0,
            0});
            this.nudMagnificationCoefficient.Name = "nudMagnificationCoefficient";
            this.nudMagnificationCoefficient.Size = new System.Drawing.Size(66, 20);
            this.nudMagnificationCoefficient.TabIndex = 1;
            this.nudMagnificationCoefficient.Value = new decimal(new int[] {
            1,
            0,
            0,
            0});
            this.nudMagnificationCoefficient.ValueChanged += new System.EventHandler(this.nudMagnificationCoefficient_ValueChanged);
            // 
            // magnifiedImage
            // 
            this.magnifiedImage.Dock = System.Windows.Forms.DockStyle.Top;
            this.magnifiedImage.ImageToMagnify = null;
            this.magnifiedImage.Location = new System.Drawing.Point(0, 0);
            this.magnifiedImage.MagnificationCoefficient = 1;
            this.magnifiedImage.Name = "magnifiedImage";
            this.magnifiedImage.Size = new System.Drawing.Size(236, 277);
            this.magnifiedImage.TabIndex = 0;
            this.magnifiedImage.Text = "imageMagnifier1";
            // 
            // frmMain
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.AutoSize = true;
            this.ClientSize = new System.Drawing.Size(475, 314);
            this.Controls.Add(this.splitContainer1);
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximizeBox = false;
            this.Name = "frmMain";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "ImageMagnifier Control Demo";
            this.splitContainer1.Panel1.ResumeLayout(false);
            this.splitContainer1.Panel1.PerformLayout();
            this.splitContainer1.Panel2.ResumeLayout(false);
            this.splitContainer1.Panel2.PerformLayout();
            this.splitContainer1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.originalImage)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.nudMagnificationCoefficient)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.SplitContainer splitContainer1;
        private System.Windows.Forms.Button btnLoadImg;
        private System.Windows.Forms.PictureBox originalImage;
        private ImageMagnifier.ImageMagnifier magnifiedImage;
        private System.Windows.Forms.CheckBox chbZoom;
        private System.Windows.Forms.Label lblMagnificationCoefficient;
        private System.Windows.Forms.NumericUpDown nudMagnificationCoefficient;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United Kingdom United Kingdom
Work: HSBC (http://www.hsbc.co.uk/).
Regalia: PhD in CS, MCAD, MCPD: Web Developer, MCTS: .Net Framework 2.0., 3.5.
Interests: Programming, artificial intelligence, C#, .NET, HTML5, ASP.NET, SQL, LINQ.
Marital Status: Married, daughter
Blog: http://www.magomedov.co.uk

Comments and Discussions