Click here to Skip to main content
15,884,177 members
Articles / Multimedia / GDI+

Photoshop-Like Gradient Editor

Rate me:
Please Sign up or sign in to vote.
4.31/5 (15 votes)
16 Feb 2006Ms-RL3 min read 57K   1.5K   41  
A Photoshop-like gradient builder control for paint applications.
namespace TestApplication
{
    partial class Form1
    {
        /// <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()
        {
            Inferno.Utilities.Gradient gradient1 = new Inferno.Utilities.Gradient();
            System.Drawing.Drawing2D.ColorBlend colorBlend1 = new System.Drawing.Drawing2D.ColorBlend();
            this.pnlCanvas = new System.Windows.Forms.Panel();
            this.gradEditor = new Inferno.Utilities.GradientTypeEditorUI();
            this.SuspendLayout();
            // 
            // pnlCanvas
            // 
            this.pnlCanvas.Anchor = ( (System.Windows.Forms.AnchorStyles)( ( ( ( System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom ) 
            | System.Windows.Forms.AnchorStyles.Left ) 
            | System.Windows.Forms.AnchorStyles.Right ) ) );
            this.pnlCanvas.Location = new System.Drawing.Point( 12, 12 );
            this.pnlCanvas.Name = "pnlCanvas";
            this.pnlCanvas.Size = new System.Drawing.Size( 587, 302 );
            this.pnlCanvas.TabIndex = 1;
            this.pnlCanvas.Paint += new System.Windows.Forms.PaintEventHandler( this.pnlCanvas_Paint );
            // 
            // gradEditor
            // 
            this.gradEditor.Anchor = ( (System.Windows.Forms.AnchorStyles)( ( ( System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom ) 
            | System.Windows.Forms.AnchorStyles.Left ) ) );
            colorBlend1.Colors = new System.Drawing.Color[] {
        System.Drawing.Color.White,
        System.Drawing.Color.White};
            colorBlend1.Positions = new float[] {
        0F,
        1F};
            gradient1.ColorBlend = colorBlend1;
            gradient1.GradientDirection = System.Drawing.Drawing2D.LinearGradientMode.Horizontal;
            this.gradEditor.Gradient = gradient1;
            this.gradEditor.Location = new System.Drawing.Point( 12, 320 );
            this.gradEditor.Name = "gradEditor";
            this.gradEditor.Size = new System.Drawing.Size( 359, 107 );
            this.gradEditor.TabIndex = 0;
            this.gradEditor.GradientChanged += new System.EventHandler( this.gradEditor_GradientChanged );
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F );
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size( 611, 439 );
            this.Controls.Add( this.pnlCanvas );
            this.Controls.Add( this.gradEditor );
            this.Name = "Form1";
            this.Text = "Form1";
            this.ResumeLayout( false );

        }

        #endregion

        private Inferno.Utilities.GradientTypeEditorUI gradEditor;
        private System.Windows.Forms.Panel pnlCanvas;
    }
}

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 Microsoft Reciprocal License


Written By
Architect
Sri Lanka Sri Lanka
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions