コード例 #1
0
        public static System.Drawing.Bitmap create_hue_bitmap(int width, int height)
        {
            var bitmap = new System.Drawing.Bitmap(width, height);

            using (var gfx = System.Drawing.Graphics.FromImage(bitmap))
            {
                var colorblend = new System.Drawing.Drawing2D.ColorBlend();
                const int num_steps = 34;
                var range_steps = EnumerableUtil.RangeSteps(0.0, 1.0, num_steps);

                colorblend.Colors = new System.Drawing.Color[num_steps];
                colorblend.Positions = new float[num_steps];

                double _sat = 1.0;
                double _val = 1.0;

                var colors = range_steps.Select(x => VisioAutomation.UI.ColorUtil.HSVToSystemDrawingColor(x, _sat, _val));
                var positions = range_steps.Select(x => (float) x);

                EnumerableUtil.FillArray( colorblend.Colors, colors );
                EnumerableUtil.FillArray(colorblend.Positions, positions);

                using (var brush_rainbow = new System.Drawing.Drawing2D.LinearGradientBrush(
                    new System.Drawing.Point(0, 0),
                    new System.Drawing.Point(bitmap.Width, 0),
                    System.Drawing.Color.Black,
                    System.Drawing.Color.White))
                {
                    brush_rainbow.InterpolationColors = colorblend;
                    gfx.FillRectangle(brush_rainbow, 0, 0, bitmap.Width, bitmap.Height);
                }
            }
            return bitmap;
        }
コード例 #2
0
        public static System.Drawing.Bitmap create_hue_bitmap(int width, int height)
        {
            var bitmap = new System.Drawing.Bitmap(width, height);

            using (var gfx = System.Drawing.Graphics.FromImage(bitmap))
            {
                var       colorblend  = new System.Drawing.Drawing2D.ColorBlend();
                const int num_steps   = 34;
                var       range_steps = EnumerableUtil.RangeSteps(0.0, 1.0, num_steps);

                colorblend.Colors    = new System.Drawing.Color[num_steps];
                colorblend.Positions = new float[num_steps];

                double _sat = 1.0;
                double _val = 1.0;

                var colors    = range_steps.Select(x => ColorUtil.HSVToSystemDrawingColor(x, _sat, _val));
                var positions = range_steps.Select(x => (float)x);

                EnumerableUtil.FillArray(colorblend.Colors, colors);
                EnumerableUtil.FillArray(colorblend.Positions, positions);

                using (var brush_rainbow = new System.Drawing.Drawing2D.LinearGradientBrush(
                           new System.Drawing.Point(0, 0),
                           new System.Drawing.Point(bitmap.Width, 0),
                           System.Drawing.Color.Black,
                           System.Drawing.Color.White))
                {
                    brush_rainbow.InterpolationColors = colorblend;
                    gfx.FillRectangle(brush_rainbow, 0, 0, bitmap.Width, bitmap.Height);
                }
            }
            return(bitmap);
        }
コード例 #3
0
 private System.Drawing.Drawing2D.LinearGradientBrush CreateGlassGradientBrush(System.Drawing.Rectangle Rectangle, System.Drawing.Color Color1, System.Drawing.Color Color2)
 {
     System.Drawing.Drawing2D.LinearGradientBrush linearGradientBrush = null;
     if (_GradientMode == Oranikle.Studio.Controls.StyledPanel_LinearGradientMode.None)
     {
         linearGradientBrush = new System.Drawing.Drawing2D.LinearGradientBrush(Rectangle, Color1, Color2, (System.Drawing.Drawing2D.LinearGradientMode)_GradientMode);
     }
     else
     {
         linearGradientBrush = new System.Drawing.Drawing2D.LinearGradientBrush(Rectangle, Color1, Color2, (System.Drawing.Drawing2D.LinearGradientMode)_GradientMode);
     }
     System.Drawing.Bitmap   bitmap   = new System.Drawing.Bitmap(1, Rectangle.Height);
     System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap);
     graphics.FillRectangle(linearGradientBrush, new System.Drawing.Rectangle(0, 0, 1, Rectangle.Height));
     System.Drawing.Drawing2D.ColorBlend colorBlend = new System.Drawing.Drawing2D.ColorBlend(4);
     colorBlend.Colors[0]    = bitmap.GetPixel(0, 0);
     colorBlend.Colors[1]    = bitmap.GetPixel(0, bitmap.Height / 3);
     colorBlend.Colors[2]    = bitmap.GetPixel(0, bitmap.Height - 1);
     colorBlend.Colors[3]    = bitmap.GetPixel(0, bitmap.Height / 3);
     colorBlend.Positions[0] = 0.0F;
     colorBlend.Positions[1] = 0.335F;
     colorBlend.Positions[2] = 0.335F;
     colorBlend.Positions[3] = 1.0F;
     linearGradientBrush.InterpolationColors = colorBlend;
     graphics.Dispose();
     bitmap.Dispose();
     return(linearGradientBrush);
 }
コード例 #4
0
ファイル: WindowsGraphics.cs プロジェクト: moyakiki/tesseract
        public void LinearGradient(double X1, double Y1, double X2, double Y2, double[] S, double[] A, double[] R, double[] G, double[] B)
        {
            Dash(0);

            if (brush[brush.Count - 1] != null)
            {
                brush[brush.Count - 1].Dispose();
            }

            System.Drawing.Drawing2D.LinearGradientBrush lgb = new System.Drawing.Drawing2D.LinearGradientBrush(
                new System.Drawing.PointF((float)X1, (float)Y1),
                new System.Drawing.PointF((float)X2, (float)Y2),
                System.Drawing.Color.Transparent,
                System.Drawing.Color.Transparent);

            System.Drawing.Drawing2D.ColorBlend cblend = new System.Drawing.Drawing2D.ColorBlend(S.Length);

            for (int i = 0; i < S.Length; i++)
            {
                cblend.Positions[i] = (float)S[i];
                cblend.Colors[i]    = GetColor(A[i], R[i], G[i], B[i]);
            }

            lgb.InterpolationColors = cblend;

            brush[brush.Count - 1] = lgb;
        }
コード例 #5
0
        private void Paint_Label_Background_Area(System.Windows.Forms.Label lbl)
        {
            System.Drawing.Color color = lbl.BackColor;

            Color[] ColorArray    = null;
            float[] PositionArray = null;

            ColorArray = new Color[] { ColourBlend(color, System.Drawing.SystemColors.HighlightText, 20),
                                       ColourBlend(color, System.Drawing.SystemColors.HighlightText, 30),
                                       ColourBlend(color, System.Drawing.SystemColors.HighlightText, 20),
                                       ColourBlend(color, System.Drawing.SystemColors.HighlightText, 00),
                                       ColourBlend(color, System.Drawing.SystemColors.MenuText, 20),
                                       ColourBlend(color, System.Drawing.SystemColors.MenuText, 10), };



            PositionArray = new float[] { 0.0f, .15f, .40f, .65f, .80f, 1.0f };

            System.Drawing.Drawing2D.ColorBlend blend = new System.Drawing.Drawing2D.ColorBlend();
            blend.Colors    = ColorArray;
            blend.Positions = PositionArray;

            System.Drawing.Rectangle rect = new Rectangle(0, 0, lbl.Width, lbl.Height);

            System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(rect, System.Drawing.SystemColors.MenuText, ColourBlend(System.Drawing.SystemColors.MenuText, System.Drawing.SystemColors.MenuText, 10), System.Drawing.Drawing2D.LinearGradientMode.Vertical);
            brush.InterpolationColors = blend;

            myPaintEventArgs.Graphics.FillRectangle(brush, rect);

            brush.Dispose();
        }
コード例 #6
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.Drawing.Drawing2D.ColorBlend colorBlend1 = new System.Drawing.Drawing2D.ColorBlend();
     System.Drawing.Drawing2D.ColorBlend colorBlend2 = new System.Drawing.Drawing2D.ColorBlend();
     this.timer1    = new System.Windows.Forms.Timer(this.components);
     this.waveForm1 = new WaveForm();
     this.SuspendLayout();
     //
     // timer1
     //
     this.timer1.Enabled = true;
     this.timer1.Tick   += new System.EventHandler(this.timer1_Tick);
     //
     // waveForm1
     //
     this.waveForm1.BackColor   = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(30)))), ((int)(((byte)(30)))));
     this.waveForm1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
     this.waveForm1.Dock        = System.Windows.Forms.DockStyle.Fill;
     colorBlend1.Colors         = new System.Drawing.Color[] {
         System.Drawing.Color.Red,
         System.Drawing.Color.White,
         System.Drawing.Color.Red
     };
     colorBlend1.Positions = new float[] {
         0F,
         0.5F,
         1F
     };
     this.waveForm1.InnerBlendColors = colorBlend1;
     this.waveForm1.Location         = new System.Drawing.Point(0, 0);
     this.waveForm1.Name             = "waveForm1";
     colorBlend2.Colors = new System.Drawing.Color[] {
         System.Drawing.Color.DarkRed,
         System.Drawing.Color.Brown,
         System.Drawing.Color.DarkRed
     };
     colorBlend2.Positions = new float[] {
         0F,
         0.5F,
         1F
     };
     this.waveForm1.OuterBlendColors = colorBlend2;
     this.waveForm1.Size             = new System.Drawing.Size(958, 328);
     this.waveForm1.TabIndex         = 0;
     this.waveForm1.MouseClick      += new System.Windows.Forms.MouseEventHandler(this.waveForm1_MouseClick);
     //
     // WaveFormWindow
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(958, 328);
     this.Controls.Add(this.waveForm1);
     this.KeyPreview = true;
     this.Name       = "WaveFormWindow";
     this.Text       = "WaveFormWindow";
     this.Load      += new System.EventHandler(this.WaveFormWindow_Load);
     this.ResumeLayout(false);
 }
コード例 #7
0
        public void Draw(Graphics g, int offsetX, int offsetY)
        {
            if (m_Width > 0 && m_Height > 0)
            {
                //* Fill with the backcolor
                //g.Clear(m_BackColor)
                g.FillRectangle(new SolidBrush(m_BackColor), offsetX, offsetY, this.Width, this.Height);

                //* Find the lowest digit in display
                int LowDigit = Convert.ToInt32(Math.Floor(m_Value));


                double PercentOfRoll      = m_Value - LowDigit;
                int    RollOffsetPosition = Convert.ToInt32(m_Height * PercentOfRoll);

                if ((DigitDrawings[LowDigit]) == null)
                {
                    CreateDigitImages();
                }

                //* Give the effect of rolling over the arc
                double ImageHeightCompress = this.Height;
                if (PercentOfRoll > 0)
                {
                    ImageHeightCompress = (1 - PercentOfRoll * 0.5) * this.Height;
                }

                //* Draw the digit that is rolling off the top
                g.DrawImage(DigitDrawings[LowDigit], offsetX, Convert.ToInt32(0 - RollOffsetPosition + (this.Height - ImageHeightCompress)), this.Width, Convert.ToInt32(ImageHeightCompress));

                //* Draw the next digit coming up
                if (RollOffsetPosition > 0)
                {
                    int NextDigit = LowDigit + 1;
                    if (NextDigit >= 10)
                    {
                        NextDigit = 0;
                    }
                    if (PercentOfRoll > 0)
                    {
                        ImageHeightCompress = Math.Min(this.Height, (PercentOfRoll * 1.75) * this.Height);
                    }
                    g.DrawImage(DigitDrawings[NextDigit], offsetX, 0 + m_Height - RollOffsetPosition, this.Width, Convert.ToInt32(ImageHeightCompress));
                }

                //* Overlay a shadow to give depth
                System.Drawing.Drawing2D.LinearGradientBrush gb = new System.Drawing.Drawing2D.LinearGradientBrush(new Rectangle(0, 0, m_Height, m_Width), Color.Black, Color.Black, 0, false);
                System.Drawing.Drawing2D.ColorBlend          cb = new System.Drawing.Drawing2D.ColorBlend();
                cb.Positions = new float[] { 0, 0.15F, 0.4F, 0.75F, 1.0F };
                cb.Colors    = new Color[] { Color.FromArgb(144, 0, 0, 0), Color.FromArgb(64, 0, 0, 0), Color.FromArgb(0, 0, 0, 0), Color.FromArgb(64, 0, 0, 0), Color.FromArgb(240, 0, 0, 0) };
                gb.RotateTransform(90);
                gb.InterpolationColors = cb;

                g.FillRectangle(gb, offsetX, offsetY, this.Width, this.Height);
            }
        }
コード例 #8
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.Drawing.Drawing2D.ColorBlend      colorBlend1        = new System.Drawing.Drawing2D.ColorBlend();
     Endogine.Interpolation.InterpolatorColor interpolatorColor1 = new Endogine.Interpolation.InterpolatorColor();
     System.Drawing.Drawing2D.ColorBlend      colorBlend2        = new System.Drawing.Drawing2D.ColorBlend();
     this.colorGradient1 = new Endogine.Editors.ColorEditors.ColorGradient();
     this.SuspendLayout();
     //
     // colorGradient1
     //
     colorBlend1.Colors = new System.Drawing.Color[] {
         System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))),
         System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(0))))),
         System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))))
     };
     colorBlend1.Positions = new float[] {
         0F,
         0.5F,
         1F
     };
     this.colorGradient1.ColorBlend = colorBlend1;
     colorBlend2.Colors             = new System.Drawing.Color[] {
         System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))),
         System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(0))))),
         System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))))
     };
     colorBlend2.Positions = new float[] {
         0F,
         0.5F,
         1F
     };
     interpolatorColor1.ColorBlend         = colorBlend2;
     this.colorGradient1.InterpolatorColor = interpolatorColor1;
     this.colorGradient1.Location          = new System.Drawing.Point(0, 0);
     this.colorGradient1.Margin            = new System.Windows.Forms.Padding(2);
     this.colorGradient1.Name             = "colorGradient1";
     this.colorGradient1.Size             = new System.Drawing.Size(261, 68);
     this.colorGradient1.TabIndex         = 0;
     this.colorGradient1.UseSeparateAlpha = true;
     //
     // ColorGradientForm
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(280, 78);
     this.Controls.Add(this.colorGradient1);
     this.Margin  = new System.Windows.Forms.Padding(2, 2, 2, 2);
     this.Name    = "ColorGradientForm";
     this.Text    = "ColorGradientForm";
     this.Resize += new System.EventHandler(this.ColorGradientForm_Resize);
     this.Load   += new System.EventHandler(this.ColorGradientForm_Load);
     this.ResumeLayout(false);
 }
コード例 #9
0
        public override string ToString()
        {
            string result = "";

            System.Drawing.Drawing2D.ColorBlend blend = this.ColorBlend;
            for (int i = 0; i < blend.Colors.Length; i++)
            {
                ColorEx.ColorRgb clr = new Endogine.ColorEx.ColorRgb(blend.Colors[i]);
                string           pos = "" + blend.Positions[i];
                result += pos.Replace(",", ".") + ":" + clr.ToString("X") + "@";
            }
            return(result.Remove(result.Length - 1));
        }
コード例 #10
0
        protected override void OnPaint(PaintEventArgs e)
        {
            Rectangle rec = e.ClipRectangle;

            rec.Width = (int)(rec.Width * ((double)Value / Maximum)) - 4;

            if (ProgressBarRenderer.IsSupported)
            {
                ProgressBarRenderer.DrawHorizontalBar(e.Graphics, e.ClipRectangle);
            }
            else
            {
                e.Graphics.DrawRectangle(Pens.Gray, 0, 0, this.Width, this.Height);
            }

            rec.Height = rec.Height - 4;

            using (System.Drawing.Drawing2D.LinearGradientBrush l =
                       new System.Drawing.Drawing2D.LinearGradientBrush(e.ClipRectangle, Color.Green, Color.Red, 0F))
            {
                System.Drawing.Drawing2D.ColorBlend lb = new System.Drawing.Drawing2D.ColorBlend();
                lb.Colors             = new Color[] { Color.LightCoral, Color.Firebrick, Color.Maroon };
                lb.Positions          = new float[] { 0, 0.55F, 1.0F };
                l.InterpolationColors = lb;

                e.Graphics.FillRectangle(l, 2, 2, rec.Width, rec.Height);
            }

            using (System.Drawing.Drawing2D.LinearGradientBrush l2 =
                       new System.Drawing.Drawing2D.LinearGradientBrush(e.ClipRectangle, Color.FromArgb(147, 255, 255, 255), Color.FromArgb(0, 255, 255, 255), System.Drawing.Drawing2D.LinearGradientMode.Vertical))
            {
                System.Drawing.Drawing2D.ColorBlend lb = new System.Drawing.Drawing2D.ColorBlend();
                lb.Colors = new Color[] { Color.FromArgb(40, 255, 255, 255), Color.FromArgb(147, 255, 255, 255),
                                          Color.FromArgb(40, 255, 255, 255), Color.FromArgb(0, 255, 255, 255) };
                lb.Positions           = new float[] { 0, 0.12F, 0.39F, 1.0F };
                l2.InterpolationColors = lb;

                l2.WrapMode = System.Drawing.Drawing2D.WrapMode.Tile;
                e.Graphics.FillRectangle(l2, 2, 2, rec.Width, rec.Height);
            }

            if (this.ShowText)
            {
                using (SolidBrush sb = new SolidBrush(this.ForeColor))
                {
                    SizeF sz = e.Graphics.MeasureString(Percentage.ToString() + " %", this.Font);
                    e.Graphics.DrawString(Percentage.ToString() + " %", this.Font, sb,
                                          new PointF((this.Width - sz.Width) / 2F, (this.Height - sz.Height) / 2F));
                }
            }
        }
コード例 #11
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.Drawing.Drawing2D.ColorBlend colorBlend1 = new System.Drawing.Drawing2D.ColorBlend();
            Endogine.Interpolation.InterpolatorColor interpolatorColor1 = new Endogine.Interpolation.InterpolatorColor();
            System.Drawing.Drawing2D.ColorBlend colorBlend2 = new System.Drawing.Drawing2D.ColorBlend();
            this.colorGradient1 = new Endogine.Editors.ColorEditors.ColorGradient();
            this.SuspendLayout();
            // 
            // colorGradient1
            // 
            colorBlend1.Colors = new System.Drawing.Color[] {
        System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))),
        System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(0))))),
        System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))))};
            colorBlend1.Positions = new float[] {
        0F,
        0.5F,
        1F};
            this.colorGradient1.ColorBlend = colorBlend1;
            colorBlend2.Colors = new System.Drawing.Color[] {
        System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))),
        System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(0))))),
        System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))))};
            colorBlend2.Positions = new float[] {
        0F,
        0.5F,
        1F};
            interpolatorColor1.ColorBlend = colorBlend2;
            this.colorGradient1.InterpolatorColor = interpolatorColor1;
            this.colorGradient1.Location = new System.Drawing.Point(0, 0);
            this.colorGradient1.Margin = new System.Windows.Forms.Padding(2);
            this.colorGradient1.Name = "colorGradient1";
            this.colorGradient1.Size = new System.Drawing.Size(261, 68);
            this.colorGradient1.TabIndex = 0;
            this.colorGradient1.UseSeparateAlpha = true;
            // 
            // ColorGradientForm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(280, 78);
            this.Controls.Add(this.colorGradient1);
            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.Name = "ColorGradientForm";
            this.Text = "ColorGradientForm";
            this.Resize += new System.EventHandler(this.ColorGradientForm_Resize);
            this.Load += new System.EventHandler(this.ColorGradientForm_Load);
            this.ResumeLayout(false);

        }
コード例 #12
0
        private void PaintGradient()
        {
            string strBMPath = string.Empty;

            System.Drawing.Drawing2D.LinearGradientBrush gradBrushButton;
            Graphics grObject;

            System.Drawing.Drawing2D.ColorBlend clrblend = null;
            Rectangle objrect;
            Bitmap    objbmp = null;

            Color[] clrSet = new Color[4] {
                Color.FromArgb(119, 187, 255),
                Color.FromArgb(210, 232, 255),
                Color.FromArgb(232, 244, 255),
                Color.FromArgb(255, 255, 255)
            };
            clrblend        = new System.Drawing.Drawing2D.ColorBlend();
            clrblend.Colors = clrSet;
            Single[] bPts = new Single[4] {
                0,
                0.5F,
                0.8F,
                1
            };
            clrblend.Positions = bPts;
            gradBrushButton    = new System.Drawing.Drawing2D.LinearGradientBrush(new
                                                                                  Point(0, 0), new Point(this.Width, this.Height), Color.FromArgb(217, 230, 255), Color.White);
            gradBrushButton.InterpolationColors = clrblend;
            objrect = new Rectangle(0, 0, this.Width, this.Height);
            objbmp  = new Bitmap(this.Width, this.Height);

            grObject = Graphics.FromImage(objbmp);
            grObject.FillRectangle(gradBrushButton, objrect);

            btnCancel.BackgroundImage       = objbmp;
            btnCancel.BackgroundImageLayout = ImageLayout.Stretch;

            btnOK.BackgroundImage       = objbmp;
            btnOK.BackgroundImageLayout = ImageLayout.Stretch;

            btnTestConnection.BackgroundImage       = objbmp;
            btnTestConnection.BackgroundImageLayout = ImageLayout.Stretch;

            SsTrip.BackgroundImage       = objbmp;
            SsTrip.BackgroundImageLayout = ImageLayout.Stretch;

            this.BackgroundImage       = objbmp;
            this.BackgroundImageLayout = ImageLayout.Stretch;
        }
コード例 #13
0
 public InterpolatorColor(string gradient)
 {
     this.Clear();
     string[] parts = gradient.Split('@');
     System.Drawing.Drawing2D.ColorBlend blend = new System.Drawing.Drawing2D.ColorBlend(parts.Length);
     for (int i = 0; i < parts.Length; i++)
     {
         string[] posAndColor = parts[i].Split(':');
         float    pos         = Convert.ToSingle(posAndColor[0], System.Globalization.CultureInfo.InvariantCulture.NumberFormat); //TODO: should always be . separator! FormatProvider.
         blend.Positions[i] = pos;
         ColorEx.ColorRgb clr = new Endogine.ColorEx.ColorRgb(posAndColor[1]);
         blend.Colors[i] = clr.ColorRGBA;
     }
     this.ColorBlend = blend;
 }
コード例 #14
0
 public InterpolatorColor(string gradient)
 {
     this.Clear();
     string[] parts = gradient.Split('@');
     System.Drawing.Drawing2D.ColorBlend blend = new System.Drawing.Drawing2D.ColorBlend(parts.Length);
     for (int i = 0; i < parts.Length; i++)
     {
         string[] posAndColor = parts[i].Split(':');
         float pos = Convert.ToSingle(posAndColor[0], System.Globalization.CultureInfo.InvariantCulture.NumberFormat); //TODO: should always be . separator! FormatProvider.
         blend.Positions[i] = pos;
         ColorEx.ColorRgb clr = new Endogine.ColorEx.ColorRgb(posAndColor[1]);
         blend.Colors[i] = clr.ColorRGBA;
     }
     this.ColorBlend = blend;
 }
コード例 #15
0
        private System.Drawing.Bitmap BuildGradient()
        {
            System.Drawing.Bitmap b = new System.Drawing.Bitmap(100, 1);
            //creates the gradient scale which the display is based upon...
            System.Drawing.Drawing2D.LinearGradientBrush br = new System.Drawing.Drawing2D.LinearGradientBrush(new System.Drawing.RectangleF(0, 0, 100, 5), System.Drawing.Color.Black, System.Drawing.Color.Black, 0, false);
            System.Drawing.Drawing2D.ColorBlend          cb = new System.Drawing.Drawing2D.ColorBlend();
            cb.Positions           = new[] { 0, 1 / 6f, 2 / 6f, 3 / 6f, 4 / 6f, 5 / 6f, 1 };
            cb.Colors              = new[] { System.Drawing.Color.Red, System.Drawing.Color.Orange, System.Drawing.Color.Yellow, System.Drawing.Color.Green, System.Drawing.Color.Blue, System.Drawing.Color.FromArgb(153, 204, 255), System.Drawing.Color.White };
            br.InterpolationColors = cb;

            //puts the gradient scale onto a bitmap which allows for getting a color from pixel
            System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(b);
            g.FillRectangle(br, new System.Drawing.RectangleF(0, 0, b.Width, b.Height));

            return(b);
        }
コード例 #16
0
            // Protected:
            #region Protected

            // Overrides:
            #region Overrides

            protected override Texture2D GetTexture(GraphicsDevice device)
            {
                if (_colourPalette is null || this.texture is null)
                {
                    // dispose of old values
                    _colourPalette?.Dispose();
                    this.texture?.Dispose();

                    // save current bounds
                    var bounds = this.Bounds;

                    // colour palette
                    var blend = new System.Drawing.Drawing2D.ColorBlend
                    {
                        Colors    = new System.Drawing.Color[] { System.Drawing.Color.Red, System.Drawing.Color.Orange, System.Drawing.Color.Yellow, System.Drawing.Color.Lime, System.Drawing.Color.Cyan, System.Drawing.Color.Blue, System.Drawing.Color.Indigo, System.Drawing.Color.Violet, System.Drawing.Color.HotPink },
                        Positions = new Single[] { 0f, 1 / 8f, 2 / 8f, 3 / 8f, 4 / 8f, 5 / 8f, 6 / 8f, 7 / 8f, 1f }
                    };

                    // prep palette
                    _colourPalette = new System.Drawing.Bitmap(bounds.Width, bounds.Height);

                    // prep temporary palette graphics items
                    using var graphics = System.Drawing.Graphics.FromImage(_colourPalette);
                    using var gradientColourPalette = new System.Drawing.Drawing2D.LinearGradientBrush(new System.Drawing.RectangleF(0f, 0f, bounds.Width, bounds.Height), System.Drawing.Color.Transparent, System.Drawing.Color.Transparent, 0f)
                          {
                              InterpolationColors = blend
                          };
                    using var gradientFadeToBlack = new System.Drawing.Drawing2D.LinearGradientBrush(new System.Drawing.RectangleF(0f, 0f, bounds.Width, bounds.Height * 0.4f), System.Drawing.Color.Black, System.Drawing.Color.Transparent, 90f);
                    using var gradientFadeToWhite = new System.Drawing.Drawing2D.LinearGradientBrush(new System.Drawing.RectangleF(0f, bounds.Height * 0.6f, bounds.Width, bounds.Height * 0.4f), System.Drawing.Color.Transparent, System.Drawing.Color.White, 90f);

                    // draw palette
                    graphics.FillRectangle(gradientColourPalette, 0f, 0f, bounds.Width, bounds.Height);
                    graphics.FillRectangle(gradientFadeToBlack, 0f, 0f, bounds.Width, bounds.Height * 0.4f);
                    graphics.FillRectangle(gradientFadeToWhite, 0f, (bounds.Height * 0.6f), bounds.Width, bounds.Height * 0.4f);

                    // export to MemoryStream
                    using var s = new MemoryStream();
                    _colourPalette.Save(s, System.Drawing.Imaging.ImageFormat.Png);
                    s.Seek(0, SeekOrigin.Begin);

                    // draw to Texture2D
                    this.texture = Texture2D.FromStream(device, s);
                }

                return(this.texture);
            }
コード例 #17
0
        /// <summary>
        /// Repaints the invalidated area of the bar to indicate the currently shown value
        /// </summary>
        /// <param name="e"></param>
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            float     brushAngle;
            Rectangle filledRect;
            Rectangle unfilledRect;

            switch (BarOrientation)
            {
            case Orientation.Horizontal:
                filledRect   = new Rectangle(ClientRectangle.X, ClientRectangle.Y, FilledWidth(ShownValue), Height);
                unfilledRect = new Rectangle(filledRect.Right, ClientRectangle.Y, Width - filledRect.Width, Height);
                brushAngle   = 0f;
                break;

            case Orientation.Vertical:
                int h = FilledHeight(ShownValue);
                filledRect   = new Rectangle(ClientRectangle.X, ClientRectangle.Bottom - h, Width, h);
                unfilledRect = new Rectangle(ClientRectangle.X, filledRect.Top, Width, Height - filledRect.Height);
                brushAngle   = -90f;
                break;

            default:
                throw new ApplicationException(String.Format(
                                                   "Unknown Orientation {0:d}", BarOrientation));
            }
            filledRect.Intersect(e.ClipRectangle);
            unfilledRect.Intersect(e.ClipRectangle);
            SolidBrush sb = new SolidBrush(BackColor);

            e.Graphics.FillRectangle(sb, unfilledRect);
            System.Drawing.Drawing2D.LinearGradientBrush lgb
                = new System.Drawing.Drawing2D.LinearGradientBrush(ClientRectangle, ForeColor, SpectrumEndColor, brushAngle);
            System.Drawing.Drawing2D.ColorBlend cb = new System.Drawing.Drawing2D.ColorBlend(4);
            cb.Colors[0]            = ForeColor;
            cb.Colors[1]            = ForeColor;
            cb.Colors[2]            = SpectrumEndColor;
            cb.Colors[3]            = SpectrumEndColor;
            cb.Positions[0]         = 0f;
            cb.Positions[1]         = (float)(1f + 12f / Minimum);
            cb.Positions[2]         = (float)(1f + 6f / Minimum);
            cb.Positions[3]         = 1f;
            lgb.InterpolationColors = cb;
            e.Graphics.FillRectangle(lgb, filledRect);
        }
コード例 #18
0
        /// <summary>
        /// To set the button and form color
        /// </summary>
        /// <param name=></param>
        /// <returns></returns>      
        /// Author             Date              Description
        /// ---------------------------------------------------
        /// Vineetha Mathew      19-02-2009        Intial Version 
        /// 
        private void PaintGradient()
        {
            string strBMPath = string.Empty;
            System.Drawing.Drawing2D.LinearGradientBrush gradBrushButton;
            Graphics grObject;
            System.Drawing.Drawing2D.ColorBlend clrblend = null;
            Rectangle objrect;
            Bitmap objbmp = null;
          
                Color[] clrSet = new Color[4]{                                      
                                    Color.FromArgb(119,187,255),                                                                        
                                     Color.FromArgb(210,232,255),
                                     Color.FromArgb(232,244,255),
                                    Color.FromArgb(255,255,255)};
                clrblend = new System.Drawing.Drawing2D.ColorBlend();
                clrblend.Colors = clrSet;
                Single[] bPts = new Single[4]{
                                            0,                                          
                                            0.5F,
                                            0.8F,                                          
                                            1};
                clrblend.Positions = bPts;
                gradBrushButton = new System.Drawing.Drawing2D.LinearGradientBrush(new
                       Point(0, 0), new Point(this.Width, this.Height), Color.FromArgb(217, 230, 255), Color.White);
                gradBrushButton.InterpolationColors = clrblend;
                objrect = new Rectangle(0, 0, this.Width, this.Height);
                objbmp = new Bitmap(this.Width, this.Height);              

                grObject = Graphics.FromImage(objbmp);
                grObject.FillRectangle(gradBrushButton, objrect);

                btnCancel.BackgroundImage = objbmp;
                btnLogin.BackgroundImage = objbmp;
                btnExit.BackgroundImage = objbmp;
                btnCancel.BackgroundImageLayout = ImageLayout.Stretch;
                btnLogin.BackgroundImageLayout = ImageLayout.Stretch;
                btnExit.BackgroundImageLayout = ImageLayout.Stretch;

                this.BackgroundImage = objbmp;
                this.BackgroundImageLayout = ImageLayout.Stretch;
          
        }
コード例 #19
0
        public static System.Drawing.Brush ToGdiBrush(this Brush brush, double width, double height)
        {
            if (brush == null)
            {
                return(null);
            }
            else if (brush is SolidColorBrush)
            {
                return(new System.Drawing.SolidBrush((brush as SolidColorBrush).Color.ToGdiColor()));
            }
            else if (brush is LinearGradientBrush)
            {
                var b = brush as LinearGradientBrush;

                double angle = Math.Atan2(b.EndPoint.Y - b.StartPoint.Y, b.EndPoint.X - b.StartPoint.X) * 180 / Math.PI;

                System.Drawing.Drawing2D.LinearGradientBrush gradient = new System.Drawing.Drawing2D.LinearGradientBrush(new System.Drawing.Rectangle(0, 0, width.ToInt32(), height.ToInt32()), System.Drawing.Color.Black, System.Drawing.Color.Black, (float)angle);

                System.Drawing.Drawing2D.ColorBlend blend = new System.Drawing.Drawing2D.ColorBlend();

                List <System.Drawing.Color> colors = new List <System.Drawing.Color>();
                List <float> offsets = new List <float>();

                foreach (var stop in b.GradientStops)
                {
                    colors.Add(stop.Color.ToGdiColor());
                    offsets.Add((float)stop.Offset);
                }

                blend.Colors    = colors.ToArray();
                blend.Positions = offsets.ToArray();

                gradient.InterpolationColors = blend;

                return(gradient);
            }
            else
            {
                throw new NotSupportedException($"Unsupported brush type {brush.GetType().Name}.");
            }
        }
コード例 #20
0
        private static readonly Dictionary <int, PointF[]> g_RadialPoints = new Dictionary <int, PointF[]>();       // key is the size of the rectangle; value is the list of points needed for a gradient brush
        private static Brush CreateGradientBrush(int size, Color light, Color dark)
        {
            if (!g_RadialPoints.ContainsKey(size))
            {
                PointF[] points = CreateRadialPoints(new PointF(size / 3 + INSET, size / 3 + INSET), size / 2);
                g_RadialPoints.Add(size, points);
            }

            System.Drawing.Drawing2D.PathGradientBrush br = new System.Drawing.Drawing2D.PathGradientBrush(g_RadialPoints[size]);
            // Create new color blend to tell the PathGradientBrush what colors to use and where to put them
            System.Drawing.Drawing2D.ColorBlend gradientSpecifications = new System.Drawing.Drawing2D.ColorBlend(3);

            // Define positions of gradient colors
            gradientSpecifications.Positions = new float[] { 0, 1 };
            // Define gradient colors and their alpha values, adjust alpha of gradient colors to match intensity
            gradientSpecifications.Colors = new Color[] { dark, light };

            // Pass off color blend to PathGradientBrush to instruct it how to generate the gradient
            br.InterpolationColors = gradientSpecifications;
            return(br);
        }
コード例 #21
0
        System.Drawing.Brush GetBrush(System.Drawing.RectangleF bounds)
        {
            if (gradient != null)
            {
                var brush = gradient.Tag as System.Drawing.Brush;
                if (brush != null)
                {
                    return(brush);
                }

                var n  = gradient.Colors.Count;
                var p1 = new System.Drawing.PointF(gradient.Start.X, gradient.Start.Y);
                var p2 = new System.Drawing.PointF(gradient.End.X, gradient.End.Y);
                var c1 = gradient.Colors[0].GetGdipColor();
                var c2 = gradient.Colors[n - 1].GetGdipColor();

                var distance = gradient.Start.DistanceTo(gradient.End);

                var blend = new System.Drawing.Drawing2D.ColorBlend(n);
                blend.Colors[0] = c1;
                for (var i = 1; i < n - 1; i++)
                {
                    blend.Colors[i] = gradient.Colors[i].GetGdipColor();
                }
                blend.Colors[n - 1] = c2;
                blend.Positions[0]  = 0;
                for (var i = 1; i < n - 1; i++)
                {
                    blend.Positions[i] = gradient.Locations[i];
                }
                blend.Positions[n - 1] = 1;

                var b = new System.Drawing.Drawing2D.LinearGradientBrush(p1, p2, c1, c2);
                b.InterpolationColors = blend;
                gradient.Tag          = b;
                return(b);
            }
            return(color.GetBrush());
        }
コード例 #22
0
        public static GDI.Brush ConvertWpfBrush2GDI(Brush brush, int rowHeight)
        {
            // 目前只支持这两种画刷的Style
            if (brush is SolidColorBrush)
            {
                Color color = (brush as SolidColorBrush).Color;
                return(new GDI.SolidBrush(GDI.Color.FromArgb(color.A, color.R, color.G, color.B)));
            }
            else if (brush is LinearGradientBrush)
            {
                LinearGradientBrush wpfBrush = brush as LinearGradientBrush;

                GDI.Drawing2D.LinearGradientBrush gdibrush = new GDI.Drawing2D.LinearGradientBrush(new GDI.PointF((float)wpfBrush.StartPoint.X, 0), new GDI.PointF((float)wpfBrush.EndPoint.X, (float)rowHeight), GDI.Color.White, GDI.Color.White);
                GDI.Drawing2D.ColorBlend          cblend   = new GDI.Drawing2D.ColorBlend(wpfBrush.GradientStops.Count);
                cblend.Colors    = new GDI.Color[wpfBrush.GradientStops.Count];
                cblend.Positions = new float[wpfBrush.GradientStops.Count];
                // 先对offset排个序吧
                SortedList <float, int> valuelist = new SortedList <float, int>();
                for (int j = 0; j < cblend.Colors.Length; ++j)
                {
                    valuelist.Add((float)wpfBrush.GradientStops[j].Offset, j);
                }
                int i = 0;
                foreach (KeyValuePair <float, int> kvp in valuelist)
                {
                    cblend.Colors[i]    = GDI.Color.FromArgb(wpfBrush.GradientStops[kvp.Value].Color.A, wpfBrush.GradientStops[kvp.Value].Color.R, wpfBrush.GradientStops[kvp.Value].Color.G, wpfBrush.GradientStops[kvp.Value].Color.B);
                    cblend.Positions[i] = kvp.Key;
                    i++;
                }

                gdibrush.InterpolationColors = cblend;
                return(gdibrush);
            }
            else
            {
                return(null); // 暂不支持转换
            }
        }
コード例 #23
0
        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
          System.Windows.Forms.Label label1;
          System.Windows.Forms.Label label2;
          System.Windows.Forms.Label label3;
          System.Windows.Forms.Label label4;
          System.Windows.Forms.Label label5;
          Gradient gradient1 = new Gradient();
          System.Drawing.Drawing2D.ColorBlend colorBlend1 = new System.Drawing.Drawing2D.ColorBlend();
          System.ComponentModel.StringConverter stringConverter1 = new System.ComponentModel.StringConverter();
          this.gradientBuilder = new GradientBuilder();
          this.grpEditor = new System.Windows.Forms.GroupBox();
          this.opacityBox = new System.Windows.Forms.NumericUpDown();
          this.positionBox = new System.Windows.Forms.NumericUpDown();
          this.colorEditor = new GenericValueEditor();
          label1 = new System.Windows.Forms.Label();
          label2 = new System.Windows.Forms.Label();
          label3 = new System.Windows.Forms.Label();
          label4 = new System.Windows.Forms.Label();
          label5 = new System.Windows.Forms.Label();
          this.grpEditor.SuspendLayout();
          ((System.ComponentModel.ISupportInitialize)(this.opacityBox)).BeginInit();
          ((System.ComponentModel.ISupportInitialize)(this.positionBox)).BeginInit();
          this.SuspendLayout();
          // 
          // label1
          // 
          label1.AutoSize = true;
          label1.Location = new System.Drawing.Point(6, 22);
          label1.Name = "label1";
          label1.Size = new System.Drawing.Size(31, 13);
          label1.TabIndex = 1;
          label1.Text = "Color";
          // 
          // label2
          // 
          label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
          label2.AutoSize = true;
          label2.Location = new System.Drawing.Point(115, 49);
          label2.Name = "label2";
          label2.Size = new System.Drawing.Size(44, 13);
          label2.TabIndex = 1;
          label2.Text = "Position";
          // 
          // label3
          // 
          label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
          label3.AutoSize = true;
          label3.Location = new System.Drawing.Point(204, 49);
          label3.Name = "label3";
          label3.Size = new System.Drawing.Size(15, 13);
          label3.TabIndex = 1;
          label3.Text = "%";
          // 
          // label4
          // 
          label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
          label4.AutoSize = true;
          label4.Location = new System.Drawing.Point(7, 49);
          label4.Name = "label4";
          label4.Size = new System.Drawing.Size(43, 13);
          label4.TabIndex = 1;
          label4.Text = "Opacity";
          // 
          // label5
          // 
          label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
          label5.AutoSize = true;
          label5.Location = new System.Drawing.Point(95, 49);
          label5.Name = "label5";
          label5.Size = new System.Drawing.Size(15, 13);
          label5.TabIndex = 1;
          label5.Text = "%";
          // 
          // gradientBuilder
          // 
          this.gradientBuilder.Dock = System.Windows.Forms.DockStyle.Fill;
          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.gradientBuilder.Gradient = gradient1;
          this.gradientBuilder.Location = new System.Drawing.Point(224, 0);
          this.gradientBuilder.Name = "gradientBuilder";
          this.gradientBuilder.Size = new System.Drawing.Size(341, 78);
          this.gradientBuilder.TabIndex = 0;
          this.gradientBuilder.Text = "gradientBuilder1";
          this.gradientBuilder.MarkerSelected += new System.EventHandler(this.gradientBuilder_MarkerSelected);
          this.gradientBuilder.GradientChanged += new System.EventHandler(this.gradientBuilder_GradientChanged);
          // 
          // grpEditor
          // 
          this.grpEditor.Controls.Add(this.opacityBox);
          this.grpEditor.Controls.Add(this.positionBox);
          this.grpEditor.Controls.Add(label5);
          this.grpEditor.Controls.Add(label3);
          this.grpEditor.Controls.Add(label2);
          this.grpEditor.Controls.Add(label4);
          this.grpEditor.Controls.Add(label1);
          this.grpEditor.Controls.Add(this.colorEditor);
          this.grpEditor.Dock = System.Windows.Forms.DockStyle.Left;
          this.grpEditor.Enabled = false;
          this.grpEditor.Location = new System.Drawing.Point(0, 0);
          this.grpEditor.Name = "grpEditor";
          this.grpEditor.Size = new System.Drawing.Size(224, 78);
          this.grpEditor.TabIndex = 1;
          this.grpEditor.TabStop = false;
          this.grpEditor.Text = "Color Stops";
          // 
          // opacityBox
          // 
          this.opacityBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
          this.opacityBox.Location = new System.Drawing.Point(56, 47);
          this.opacityBox.Name = "opacityBox";
          this.opacityBox.Size = new System.Drawing.Size(41, 20);
          this.opacityBox.TabIndex = 3;
          this.opacityBox.Value = new decimal(new int[] {
            100,
            0,
            0,
            0});
          this.opacityBox.ValueChanged += new System.EventHandler(this.colorMixerFieldValueChanged);
          // 
          // positionBox
          // 
          this.positionBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
          this.positionBox.Location = new System.Drawing.Point(165, 47);
          this.positionBox.Name = "positionBox";
          this.positionBox.Size = new System.Drawing.Size(41, 20);
          this.positionBox.TabIndex = 2;
          this.positionBox.ValueChanged += new System.EventHandler(this.colorMixerFieldValueChanged);
          // 
          // colorEditor
          // 
          this.colorEditor.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                      | System.Windows.Forms.AnchorStyles.Right)));
          this.colorEditor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
          this.colorEditor.Converter = stringConverter1;
          this.colorEditor.Location = new System.Drawing.Point(56, 19);
          this.colorEditor.Name = "colorEditor";
          this.colorEditor.Size = new System.Drawing.Size(162, 20);
          this.colorEditor.TabIndex = 0;
          this.colorEditor.ValueChanged += new System.EventHandler(this.colorMixerFieldValueChanged);
          // 
          // GradientTypeEditorUI
          // 
          this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
          this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
          this.Controls.Add(this.gradientBuilder);
          this.Controls.Add(this.grpEditor);
          this.Name = "GradientTypeEditorUI";
          this.Size = new System.Drawing.Size(565, 78);
          this.grpEditor.ResumeLayout(false);
          this.grpEditor.PerformLayout();
          ((System.ComponentModel.ISupportInitialize)(this.opacityBox)).EndInit();
          ((System.ComponentModel.ISupportInitialize)(this.positionBox)).EndInit();
          this.ResumeLayout(false);

        }
コード例 #24
0
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
      this.components = new System.ComponentModel.Container();
      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AttentionMapModule));
      OgamaControls.Gradient gradient2 = new OgamaControls.Gradient();
      System.Drawing.Drawing2D.ColorBlend colorBlend2 = new System.Drawing.Drawing2D.ColorBlend();
      this.bgwCalcMap = new System.ComponentModel.BackgroundWorker();
      this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
      this.trvSubjects = new OgamaControls.CheckboxTreeView(this.components);
      this.imlTreeViewSubjects = new System.Windows.Forms.ImageList(this.components);
      this.gradientControl = new OgamaControls.GradientTypeEditorUI();
      this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
      this.spcPictureGradient = new System.Windows.Forms.SplitContainer();
      this.spcPicAndList = new System.Windows.Forms.SplitContainer();
      this.toolStripContainer2 = new System.Windows.Forms.ToolStripContainer();
      this.toolStrip2 = new System.Windows.Forms.ToolStrip();
      this.btnSeekNextSlide = new System.Windows.Forms.ToolStripButton();
      this.btnSeekPreviousSlide = new System.Windows.Forms.ToolStripButton();
      this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
      this.trialTimeLine = new TrialTimeLine(this.components);
      this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
      this.trbZoom = new OgamaControls.ToolStripTrackBar();
      this.pnlCanvas = new System.Windows.Forms.Panel();
      this.pnlPicture = new System.Windows.Forms.Panel();
      this.attentionMapPicture = new Ogama.Modules.AttentionMap.AttentionMapPicture();
      this.tosTrial = new System.Windows.Forms.ToolStrip();
      this.cbbTrial = new System.Windows.Forms.ToolStripComboBox();
      this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
      this.btnEye = new System.Windows.Forms.ToolStripButton();
      this.btnMouse = new System.Windows.Forms.ToolStripButton();
      this.btnMouseClicks = new System.Windows.Forms.ToolStripButton();
      this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
      this.btnWeight = new System.Windows.Forms.ToolStripButton();
      this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
      this.mnuGradients = new System.Windows.Forms.ToolStripDropDownButton();
      this.mnuTrafficLight = new System.Windows.Forms.ToolStripMenuItem();
      this.mnuRainbow = new System.Windows.Forms.ToolStripMenuItem();
      this.mnuBlackMask = new System.Windows.Forms.ToolStripMenuItem();
      this.mnuCustomGradient = new System.Windows.Forms.ToolStripMenuItem();
      this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
      this.mnuShowGradientBuilder = new System.Windows.Forms.ToolStripMenuItem();
      this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
      this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
      this.nudKernelSize = new OgamaControls.ToolStripNumericUpDown();
      this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
      this.btnHelp = new System.Windows.Forms.ToolStripButton();
      this.tosCalculation = new System.Windows.Forms.ToolStrip();
      this.btnStartCalculation = new System.Windows.Forms.ToolStripButton();
      this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
      this.btnAllFix = new System.Windows.Forms.ToolStripButton();
      this.btnSpecialFix = new System.Windows.Forms.ToolStripButton();
      this.nudFixNumber = new OgamaControls.ToolStripNumericUpDown();
      this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
      this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
      this.toolStripNumericUpDown1 = new OgamaControls.ToolStripNumericUpDown();
      ((System.ComponentModel.ISupportInitialize)(this.bsoSubjects)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoFKSubjectsTrials)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.ogamaDataSet)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoFKTrialsEvents)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoTrialsAOIs)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoTrialsGazeFixations)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoTrialsMouseFixations)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoShapeGroups)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoFKSubjectsSubjectParameters)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoSubjectParameters)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoTrialEvents)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoTrials)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoGazeFixations)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoMouseFixations)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoAOIs)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoParams)).BeginInit();
      this.toolStripContainer1.ContentPanel.SuspendLayout();
      this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
      this.toolStripContainer1.SuspendLayout();
      this.spcPictureGradient.Panel1.SuspendLayout();
      this.spcPictureGradient.Panel2.SuspendLayout();
      this.spcPictureGradient.SuspendLayout();
      this.spcPicAndList.Panel1.SuspendLayout();
      this.spcPicAndList.Panel2.SuspendLayout();
      this.spcPicAndList.SuspendLayout();
      this.toolStripContainer2.BottomToolStripPanel.SuspendLayout();
      this.toolStripContainer2.ContentPanel.SuspendLayout();
      this.toolStripContainer2.SuspendLayout();
      this.toolStrip2.SuspendLayout();
      this.pnlCanvas.SuspendLayout();
      this.pnlPicture.SuspendLayout();
      this.tosTrial.SuspendLayout();
      this.tosCalculation.SuspendLayout();
      this.SuspendLayout();
      // 
      // bgwCalcMap
      // 
      this.bgwCalcMap.WorkerReportsProgress = true;
      this.bgwCalcMap.WorkerSupportsCancellation = true;
      this.bgwCalcMap.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bgwCalcMap_DoWork);
      this.bgwCalcMap.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bgwCalcMap_RunWorkerCompleted);
      this.bgwCalcMap.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bgwCalcMap_ProgressChanged);
      // 
      // trvSubjects
      // 
      this.trvSubjects.CheckBoxes = true;
      this.trvSubjects.Dock = System.Windows.Forms.DockStyle.Fill;
      this.trvSubjects.ImageIndex = 0;
      this.trvSubjects.ImageList = this.imlTreeViewSubjects;
      this.trvSubjects.Location = new System.Drawing.Point(0, 0);
      this.trvSubjects.Name = "trvSubjects";
      this.trvSubjects.SelectedImageIndex = 0;
      this.trvSubjects.Size = new System.Drawing.Size(150, 341);
      this.trvSubjects.TabIndex = 11;
      this.toolTip1.SetToolTip(this.trvSubjects, "Select or deselect the subjects that you want to be included in calculation.");
      this.trvSubjects.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.trvSubjects_AfterCheck);
      // 
      // imlTreeViewSubjects
      // 
      this.imlTreeViewSubjects.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imlTreeViewSubjects.ImageStream")));
      this.imlTreeViewSubjects.TransparentColor = System.Drawing.Color.Transparent;
      this.imlTreeViewSubjects.Images.SetKeyName(0, "Categorie");
      this.imlTreeViewSubjects.Images.SetKeyName(1, "Subject");
      // 
      // gradientControl
      // 
      colorBlend2.Colors = new System.Drawing.Color[] {
        System.Drawing.Color.Transparent,
        System.Drawing.Color.Transparent};
      colorBlend2.Positions = new float[] {
        0F,
        1F};
      gradient2.ColorBlend = colorBlend2;
      gradient2.GradientDirection = System.Drawing.Drawing2D.LinearGradientMode.Horizontal;
      this.gradientControl.Gradient = gradient2;
      this.gradientControl.Location = new System.Drawing.Point(0, 0);
      this.gradientControl.Name = "gradientControl";
      this.gradientControl.Size = new System.Drawing.Size(660, 86);
      this.gradientControl.TabIndex = 1;
      this.toolTip1.SetToolTip(this.gradientControl, "Define additional color stops by clicking on the gradient.\r\nModify color stops by" +
              " clicking on the triangles.\r\nRemove a color stop by dragging it out of the gradi" +
              "ent.");
      this.gradientControl.GradientChanged += new System.EventHandler(this.gradientControl_GradientChanged);
      // 
      // toolStripContainer1
      // 
      // 
      // toolStripContainer1.ContentPanel
      // 
      this.toolStripContainer1.ContentPanel.Controls.Add(this.spcPictureGradient);
      this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(785, 431);
      this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
      this.toolStripContainer1.Location = new System.Drawing.Point(0, 0);
      this.toolStripContainer1.Name = "toolStripContainer1";
      this.toolStripContainer1.Size = new System.Drawing.Size(785, 482);
      this.toolStripContainer1.TabIndex = 1;
      this.toolStripContainer1.Text = "toolStripContainer1";
      // 
      // toolStripContainer1.TopToolStripPanel
      // 
      this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.tosTrial);
      this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.tosCalculation);
      // 
      // spcPictureGradient
      // 
      this.spcPictureGradient.Dock = System.Windows.Forms.DockStyle.Fill;
      this.spcPictureGradient.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
      this.spcPictureGradient.Location = new System.Drawing.Point(0, 0);
      this.spcPictureGradient.Name = "spcPictureGradient";
      this.spcPictureGradient.Orientation = System.Windows.Forms.Orientation.Horizontal;
      // 
      // spcPictureGradient.Panel1
      // 
      this.spcPictureGradient.Panel1.Controls.Add(this.spcPicAndList);
      // 
      // spcPictureGradient.Panel2
      // 
      this.spcPictureGradient.Panel2.Controls.Add(this.gradientControl);
      this.spcPictureGradient.Size = new System.Drawing.Size(785, 431);
      this.spcPictureGradient.SplitterDistance = 341;
      this.spcPictureGradient.TabIndex = 12;
      // 
      // spcPicAndList
      // 
      this.spcPicAndList.Dock = System.Windows.Forms.DockStyle.Fill;
      this.spcPicAndList.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
      this.spcPicAndList.Location = new System.Drawing.Point(0, 0);
      this.spcPicAndList.Name = "spcPicAndList";
      // 
      // spcPicAndList.Panel1
      // 
      this.spcPicAndList.Panel1.Controls.Add(this.trvSubjects);
      // 
      // spcPicAndList.Panel2
      // 
      this.spcPicAndList.Panel2.Controls.Add(this.toolStripContainer2);
      this.spcPicAndList.Size = new System.Drawing.Size(785, 341);
      this.spcPicAndList.SplitterDistance = 150;
      this.spcPicAndList.TabIndex = 0;
      // 
      // toolStripContainer2
      // 
      // 
      // toolStripContainer2.BottomToolStripPanel
      // 
      this.toolStripContainer2.BottomToolStripPanel.Controls.Add(this.toolStrip2);
      // 
      // toolStripContainer2.ContentPanel
      // 
      this.toolStripContainer2.ContentPanel.Controls.Add(this.pnlCanvas);
      this.toolStripContainer2.ContentPanel.Margin = new System.Windows.Forms.Padding(0);
      this.toolStripContainer2.ContentPanel.Size = new System.Drawing.Size(631, 315);
      this.toolStripContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
      this.toolStripContainer2.LeftToolStripPanelVisible = false;
      this.toolStripContainer2.Location = new System.Drawing.Point(0, 0);
      this.toolStripContainer2.Margin = new System.Windows.Forms.Padding(0);
      this.toolStripContainer2.Name = "toolStripContainer2";
      this.toolStripContainer2.RightToolStripPanelVisible = false;
      this.toolStripContainer2.Size = new System.Drawing.Size(631, 341);
      this.toolStripContainer2.TabIndex = 1;
      this.toolStripContainer2.Text = "toolStripContainer2";
      this.toolStripContainer2.TopToolStripPanelVisible = false;
      // 
      // toolStrip2
      // 
      this.toolStrip2.Dock = System.Windows.Forms.DockStyle.None;
      this.toolStrip2.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
      this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.btnSeekNextSlide,
            this.btnSeekPreviousSlide,
            this.toolStripSeparator3,
            this.trialTimeLine,
            this.toolStripSeparator10,
            this.trbZoom});
      this.toolStrip2.Location = new System.Drawing.Point(0, 0);
      this.toolStrip2.Name = "toolStrip2";
      this.toolStrip2.Size = new System.Drawing.Size(631, 26);
      this.toolStrip2.Stretch = true;
      this.toolStrip2.TabIndex = 1;
      this.toolStrip2.Text = "toolStrip2";
      // 
      // btnSeekNextSlide
      // 
      this.btnSeekNextSlide.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
      this.btnSeekNextSlide.Image = global::Ogama.Properties.Resources.DataContainer_MoveLastHS;
      this.btnSeekNextSlide.ImageTransparentColor = System.Drawing.Color.Magenta;
      this.btnSeekNextSlide.Name = "btnSeekNextSlide";
      this.btnSeekNextSlide.Size = new System.Drawing.Size(23, 23);
      this.btnSeekNextSlide.Text = "Seek to next slide";
      this.btnSeekNextSlide.Click += new System.EventHandler(this.btnSeekNextSlide_Click);
      // 
      // btnSeekPreviousSlide
      // 
      this.btnSeekPreviousSlide.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
      this.btnSeekPreviousSlide.Image = global::Ogama.Properties.Resources.DataContainer_MoveFirstHS;
      this.btnSeekPreviousSlide.ImageTransparentColor = System.Drawing.Color.Magenta;
      this.btnSeekPreviousSlide.Name = "btnSeekPreviousSlide";
      this.btnSeekPreviousSlide.Size = new System.Drawing.Size(23, 23);
      this.btnSeekPreviousSlide.Text = "Seek to previous slide.";
      this.btnSeekPreviousSlide.Click += new System.EventHandler(this.btnSeekPreviousSlide_Click);
      // 
      // toolStripSeparator3
      // 
      this.toolStripSeparator3.Name = "toolStripSeparator3";
      this.toolStripSeparator3.Size = new System.Drawing.Size(6, 26);
      // 
      // trialTimeLine
      // 
      this.trialTimeLine.Duration = 0;
      this.trialTimeLine.Name = "trialTimeLine";
      this.trialTimeLine.ShowCaret = false;
      this.trialTimeLine.ShowTimes = false;
      this.trialTimeLine.Size = new System.Drawing.Size(437, 23);
      this.trialTimeLine.Text = "trialTimeLine";
      // 
      // toolStripSeparator10
      // 
      this.toolStripSeparator10.Name = "toolStripSeparator10";
      this.toolStripSeparator10.Size = new System.Drawing.Size(6, 26);
      // 
      // trbZoom
      // 
      this.trbZoom.Maximum = 100;
      this.trbZoom.Minimum = 1;
      this.trbZoom.Name = "trbZoom";
      this.trbZoom.Size = new System.Drawing.Size(104, 23);
      this.trbZoom.TickFrequency = 1;
      this.trbZoom.TickStyle = System.Windows.Forms.TickStyle.None;
      this.trbZoom.ToolTipText = "Zoom, right-click for autozoom";
      this.trbZoom.Value = 1;
      // 
      // pnlCanvas
      // 
      this.pnlCanvas.AutoScroll = true;
      this.pnlCanvas.BackColor = global::Ogama.Properties.Settings.Default.BackgroundColorForms;
      this.pnlCanvas.Controls.Add(this.pnlPicture);
      this.pnlCanvas.DataBindings.Add(new System.Windows.Forms.Binding("BackColor", global::Ogama.Properties.Settings.Default, "BackgroundColorForms", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
      this.pnlCanvas.Dock = System.Windows.Forms.DockStyle.Fill;
      this.pnlCanvas.Location = new System.Drawing.Point(0, 0);
      this.pnlCanvas.Margin = new System.Windows.Forms.Padding(0);
      this.pnlCanvas.Name = "pnlCanvas";
      this.pnlCanvas.Size = new System.Drawing.Size(631, 315);
      this.pnlCanvas.TabIndex = 2;
      // 
      // pnlPicture
      // 
      this.pnlPicture.Controls.Add(this.attentionMapPicture);
      this.pnlPicture.Location = new System.Drawing.Point(113, 79);
      this.pnlPicture.Margin = new System.Windows.Forms.Padding(0);
      this.pnlPicture.Name = "pnlPicture";
      this.pnlPicture.Size = new System.Drawing.Size(300, 200);
      this.pnlPicture.TabIndex = 0;
      // 
      // attentionMapPicture
      // 
      this.attentionMapPicture.AnimationInterval = 10;
      this.attentionMapPicture.BackColor = System.Drawing.Color.Black;
      this.attentionMapPicture.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
      this.attentionMapPicture.InvalidateInterval = 500;
      this.attentionMapPicture.Location = new System.Drawing.Point(0, 0);
      this.attentionMapPicture.Margin = new System.Windows.Forms.Padding(0);
      this.attentionMapPicture.Name = "attentionMapPicture";
      this.attentionMapPicture.Size = new System.Drawing.Size(300, 200);
      this.attentionMapPicture.TabIndex = 0;
      this.attentionMapPicture.TabStop = false;
      this.attentionMapPicture.ZoomFactor = 0F;
      // 
      // tosTrial
      // 
      this.tosTrial.DataBindings.Add(new System.Windows.Forms.Binding("Location", global::Ogama.Properties.Settings.Default, "ATMTrialToolbarLocation", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
      this.tosTrial.Dock = System.Windows.Forms.DockStyle.None;
      this.tosTrial.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.cbbTrial,
            this.toolStripSeparator1,
            this.btnEye,
            this.btnMouse,
            this.btnMouseClicks,
            this.toolStripSeparator8,
            this.btnWeight,
            this.toolStripSeparator6,
            this.mnuGradients,
            this.toolStripSeparator2,
            this.toolStripLabel1,
            this.nudKernelSize,
            this.toolStripSeparator4,
            this.btnHelp});
      this.tosTrial.Location = global::Ogama.Properties.Settings.Default.ATMTrialToolbarLocation;
      this.tosTrial.Name = "tosTrial";
      this.tosTrial.Size = new System.Drawing.Size(647, 26);
      this.tosTrial.TabIndex = 0;
      // 
      // cbbTrial
      // 
      this.cbbTrial.AutoSize = false;
      this.cbbTrial.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
      this.cbbTrial.Name = "cbbTrial";
      this.cbbTrial.Size = new System.Drawing.Size(200, 23);
      // 
      // toolStripSeparator1
      // 
      this.toolStripSeparator1.Name = "toolStripSeparator1";
      this.toolStripSeparator1.Size = new System.Drawing.Size(6, 26);
      // 
      // btnEye
      // 
      this.btnEye.Checked = true;
      this.btnEye.CheckOnClick = true;
      this.btnEye.CheckState = System.Windows.Forms.CheckState.Checked;
      this.btnEye.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
      this.btnEye.Image = global::Ogama.Properties.Resources.Eye;
      this.btnEye.ImageTransparentColor = System.Drawing.Color.Magenta;
      this.btnEye.Name = "btnEye";
      this.btnEye.Size = new System.Drawing.Size(23, 23);
      this.btnEye.Text = "Use gaze data for attention maps.";
      this.btnEye.Click += new System.EventHandler(this.btnEye_Click);
      // 
      // btnMouse
      // 
      this.btnMouse.CheckOnClick = true;
      this.btnMouse.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
      this.btnMouse.Image = global::Ogama.Properties.Resources.Mouse;
      this.btnMouse.ImageTransparentColor = System.Drawing.Color.Magenta;
      this.btnMouse.Name = "btnMouse";
      this.btnMouse.Size = new System.Drawing.Size(23, 23);
      this.btnMouse.Text = "Use mouse fixation data for attention maps.";
      this.btnMouse.Click += new System.EventHandler(this.btnMouse_Click);
      // 
      // btnMouseClicks
      // 
      this.btnMouseClicks.CheckOnClick = true;
      this.btnMouseClicks.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
      this.btnMouseClicks.Image = global::Ogama.Properties.Resources.HandCursor;
      this.btnMouseClicks.ImageTransparentColor = System.Drawing.Color.Magenta;
      this.btnMouseClicks.Name = "btnMouseClicks";
      this.btnMouseClicks.Size = new System.Drawing.Size(23, 23);
      this.btnMouseClicks.Text = "Use mouse click data for attention maps.";
      this.btnMouseClicks.Click += new System.EventHandler(this.btnMouseClicks_Click);
      // 
      // toolStripSeparator8
      // 
      this.toolStripSeparator8.Name = "toolStripSeparator8";
      this.toolStripSeparator8.Size = new System.Drawing.Size(6, 26);
      // 
      // btnWeight
      // 
      this.btnWeight.CheckOnClick = true;
      this.btnWeight.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
      this.btnWeight.Image = global::Ogama.Properties.Resources.Weight;
      this.btnWeight.ImageTransparentColor = System.Drawing.Color.Magenta;
      this.btnWeight.Name = "btnWeight";
      this.btnWeight.Size = new System.Drawing.Size(23, 23);
      this.btnWeight.Text = "Weight fixations";
      this.btnWeight.ToolTipText = "Weight fixations by length";
      // 
      // toolStripSeparator6
      // 
      this.toolStripSeparator6.Name = "toolStripSeparator6";
      this.toolStripSeparator6.Size = new System.Drawing.Size(6, 26);
      // 
      // mnuGradients
      // 
      this.mnuGradients.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.mnuTrafficLight,
            this.mnuRainbow,
            this.mnuBlackMask,
            this.mnuCustomGradient,
            this.toolStripSeparator5,
            this.mnuShowGradientBuilder});
      this.mnuGradients.Image = global::Ogama.Properties.Resources.DisplayInColorHS;
      this.mnuGradients.ImageTransparentColor = System.Drawing.Color.Magenta;
      this.mnuGradients.Name = "mnuGradients";
      this.mnuGradients.Size = new System.Drawing.Size(136, 23);
      this.mnuGradients.Text = "Select color palette";
      this.mnuGradients.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
      this.mnuGradients.ToolTipText = "Select color palette for the attention map.";
      // 
      // mnuTrafficLight
      // 
      this.mnuTrafficLight.Checked = true;
      this.mnuTrafficLight.CheckState = System.Windows.Forms.CheckState.Checked;
      this.mnuTrafficLight.Name = "mnuTrafficLight";
      this.mnuTrafficLight.Size = new System.Drawing.Size(190, 22);
      this.mnuTrafficLight.Text = "Traffic light";
      this.mnuTrafficLight.Paint += new System.Windows.Forms.PaintEventHandler(this.mnuTrafficLight_Paint);
      this.mnuTrafficLight.Click += new System.EventHandler(this.mnuTrafficLight_Click);
      // 
      // mnuRainbow
      // 
      this.mnuRainbow.ForeColor = System.Drawing.SystemColors.ControlText;
      this.mnuRainbow.Name = "mnuRainbow";
      this.mnuRainbow.Size = new System.Drawing.Size(190, 22);
      this.mnuRainbow.Text = "Rainbow";
      this.mnuRainbow.Paint += new System.Windows.Forms.PaintEventHandler(this.mnuRainbow_Paint);
      this.mnuRainbow.Click += new System.EventHandler(this.mnuRainbow_Click);
      // 
      // mnuBlackMask
      // 
      this.mnuBlackMask.ForeColor = System.Drawing.SystemColors.ControlText;
      this.mnuBlackMask.Name = "mnuBlackMask";
      this.mnuBlackMask.Size = new System.Drawing.Size(190, 22);
      this.mnuBlackMask.Text = "Black Mask";
      this.mnuBlackMask.Paint += new System.Windows.Forms.PaintEventHandler(this.mnuBlackMask_Paint);
      this.mnuBlackMask.Click += new System.EventHandler(this.mnuBlackMask_Click);
      // 
      // mnuCustomGradient
      // 
      this.mnuCustomGradient.Name = "mnuCustomGradient";
      this.mnuCustomGradient.Size = new System.Drawing.Size(190, 22);
      this.mnuCustomGradient.Text = "Custom";
      this.mnuCustomGradient.Paint += new System.Windows.Forms.PaintEventHandler(this.mnuCustomGradient_Paint);
      this.mnuCustomGradient.Click += new System.EventHandler(this.mnuCustomGradient_Click);
      // 
      // toolStripSeparator5
      // 
      this.toolStripSeparator5.Name = "toolStripSeparator5";
      this.toolStripSeparator5.Size = new System.Drawing.Size(187, 6);
      // 
      // mnuShowGradientBuilder
      // 
      this.mnuShowGradientBuilder.CheckOnClick = true;
      this.mnuShowGradientBuilder.Image = global::Ogama.Properties.Resources.DisplayInColorHS;
      this.mnuShowGradientBuilder.Name = "mnuShowGradientBuilder";
      this.mnuShowGradientBuilder.Size = new System.Drawing.Size(190, 22);
      this.mnuShowGradientBuilder.Text = "Show gradient builder";
      this.mnuShowGradientBuilder.Click += new System.EventHandler(this.mnuShowGradientBuilder_Click);
      // 
      // toolStripSeparator2
      // 
      this.toolStripSeparator2.Name = "toolStripSeparator2";
      this.toolStripSeparator2.Size = new System.Drawing.Size(6, 26);
      // 
      // toolStripLabel1
      // 
      this.toolStripLabel1.Name = "toolStripLabel1";
      this.toolStripLabel1.Size = new System.Drawing.Size(111, 23);
      this.toolStripLabel1.Text = "Gaussian kernel size";
      // 
      // nudKernelSize
      // 
      this.nudKernelSize.DecimalPlaces = 0;
      this.nudKernelSize.Increment = new decimal(new int[] {
            2,
            0,
            0,
            0});
      this.nudKernelSize.Maximum = new decimal(new int[] {
            401,
            0,
            0,
            0});
      this.nudKernelSize.Minimum = new decimal(new int[] {
            3,
            0,
            0,
            0});
      this.nudKernelSize.Name = "nudKernelSize";
      this.nudKernelSize.Size = new System.Drawing.Size(41, 23);
      this.nudKernelSize.Text = "201";
      this.nudKernelSize.ToolTipText = "This size determines the dimension of each fixation in pixel.\r\nIncreasing this va" +
          "lue smoothes the fixation distribution visualization.";
      this.nudKernelSize.Value = new decimal(new int[] {
            201,
            0,
            0,
            0});
      this.nudKernelSize.ValueChanged += new System.EventHandler(this.nudKernelSize_ValueChanged);
      // 
      // toolStripSeparator4
      // 
      this.toolStripSeparator4.Name = "toolStripSeparator4";
      this.toolStripSeparator4.Size = new System.Drawing.Size(6, 26);
      // 
      // btnHelp
      // 
      this.btnHelp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
      this.btnHelp.Image = global::Ogama.Properties.Resources.HelpBmp;
      this.btnHelp.ImageTransparentColor = System.Drawing.Color.Magenta;
      this.btnHelp.Name = "btnHelp";
      this.btnHelp.Size = new System.Drawing.Size(23, 23);
      this.btnHelp.ToolTipText = "Display help for this module.";
      // 
      // tosCalculation
      // 
      this.tosCalculation.DataBindings.Add(new System.Windows.Forms.Binding("Location", global::Ogama.Properties.Settings.Default, "ATMCalculateToolbarLocation", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
      this.tosCalculation.Dock = System.Windows.Forms.DockStyle.None;
      this.tosCalculation.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.btnStartCalculation,
            this.toolStripSeparator7,
            this.btnAllFix,
            this.btnSpecialFix,
            this.nudFixNumber,
            this.toolStripSeparator9,
            this.toolStripLabel2,
            this.toolStripNumericUpDown1});
      this.tosCalculation.Location = global::Ogama.Properties.Settings.Default.ATMCalculateToolbarLocation;
      this.tosCalculation.Name = "tosCalculation";
      this.tosCalculation.Size = new System.Drawing.Size(192, 25);
      this.tosCalculation.TabIndex = 1;
      // 
      // btnStartCalculation
      // 
      this.btnStartCalculation.Image = global::Ogama.Properties.Resources.CalculatorHS;
      this.btnStartCalculation.ImageTransparentColor = System.Drawing.Color.Magenta;
      this.btnStartCalculation.Name = "btnStartCalculation";
      this.btnStartCalculation.Size = new System.Drawing.Size(87, 22);
      this.btnStartCalculation.Text = "Recalculate";
      this.btnStartCalculation.ToolTipText = "Starts calculation of attention map.";
      this.btnStartCalculation.Click += new System.EventHandler(this.btnStartCalculation_Click);
      // 
      // toolStripSeparator7
      // 
      this.toolStripSeparator7.Name = "toolStripSeparator7";
      this.toolStripSeparator7.Size = new System.Drawing.Size(6, 25);
      // 
      // btnAllFix
      // 
      this.btnAllFix.Checked = true;
      this.btnAllFix.CheckOnClick = true;
      this.btnAllFix.CheckState = System.Windows.Forms.CheckState.Checked;
      this.btnAllFix.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
      this.btnAllFix.Image = global::Ogama.Properties.Resources.ATMAll;
      this.btnAllFix.ImageTransparentColor = System.Drawing.Color.Magenta;
      this.btnAllFix.Name = "btnAllFix";
      this.btnAllFix.Size = new System.Drawing.Size(23, 22);
      this.btnAllFix.ToolTipText = "Use all fixations in calculation.";
      this.btnAllFix.Click += new System.EventHandler(this.btnAllFix_Click);
      // 
      // btnSpecialFix
      // 
      this.btnSpecialFix.CheckOnClick = true;
      this.btnSpecialFix.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
      this.btnSpecialFix.Image = global::Ogama.Properties.Resources.ATMFirst;
      this.btnSpecialFix.ImageTransparentColor = System.Drawing.Color.Magenta;
      this.btnSpecialFix.Name = "btnSpecialFix";
      this.btnSpecialFix.Size = new System.Drawing.Size(23, 22);
      this.btnSpecialFix.ToolTipText = "Use only a special fixation in calculation. ";
      this.btnSpecialFix.Click += new System.EventHandler(this.btnSpecialFix_Click);
      // 
      // nudFixNumber
      // 
      this.nudFixNumber.DecimalPlaces = 0;
      this.nudFixNumber.Increment = new decimal(new int[] {
            1,
            0,
            0,
            0});
      this.nudFixNumber.Maximum = new decimal(new int[] {
            100,
            0,
            0,
            0});
      this.nudFixNumber.Minimum = new decimal(new int[] {
            1,
            0,
            0,
            0});
      this.nudFixNumber.Name = "nudFixNumber";
      this.nudFixNumber.Size = new System.Drawing.Size(41, 22);
      this.nudFixNumber.Text = "1";
      this.nudFixNumber.ToolTipText = "The number of the fixation in this trial to use in calculation.\r\nFor example, sho" +
          "w only first fixation (1) or second (2).";
      this.nudFixNumber.Value = new decimal(new int[] {
            1,
            0,
            0,
            0});
      // 
      // toolStripSeparator9
      // 
      this.toolStripSeparator9.Name = "toolStripSeparator9";
      this.toolStripSeparator9.Size = new System.Drawing.Size(6, 25);
      this.toolStripSeparator9.Visible = false;
      // 
      // toolStripLabel2
      // 
      this.toolStripLabel2.Name = "toolStripLabel2";
      this.toolStripLabel2.Size = new System.Drawing.Size(57, 22);
      this.toolStripLabel2.Text = "Absolute ";
      this.toolStripLabel2.Visible = false;
      // 
      // toolStripNumericUpDown1
      // 
      this.toolStripNumericUpDown1.DecimalPlaces = 0;
      this.toolStripNumericUpDown1.Increment = new decimal(new int[] {
            1,
            0,
            0,
            0});
      this.toolStripNumericUpDown1.Maximum = new decimal(new int[] {
            100,
            0,
            0,
            0});
      this.toolStripNumericUpDown1.Minimum = new decimal(new int[] {
            0,
            0,
            0,
            0});
      this.toolStripNumericUpDown1.Name = "toolStripNumericUpDown1";
      this.toolStripNumericUpDown1.Size = new System.Drawing.Size(41, 22);
      this.toolStripNumericUpDown1.Text = "0";
      this.toolStripNumericUpDown1.Value = new decimal(new int[] {
            0,
            0,
            0,
            0});
      this.toolStripNumericUpDown1.Visible = false;
      // 
      // AttentionMapModule
      // 
      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
      this.ClientSize = new System.Drawing.Size(785, 482);
      this.Controls.Add(this.toolStripContainer1);
      this.DataBindings.Add(new System.Windows.Forms.Binding("Location", global::Ogama.Properties.Settings.Default, "AttentionMapModuleLocation", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
      this.DoubleBuffered = true;
      this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
      this.KeyPreview = true;
      this.Location = global::Ogama.Properties.Settings.Default.AttentionMapModuleLocation;
      this.Logo = global::Ogama.Properties.Resources.AttentionMapLogo;
      this.Name = "AttentionMapModule";
      this.Text = "Attention Map Module";
      this.toolTip1.SetToolTip(this, "You can export this image via Edit-Copy or  Edit-SaveImage.");
      this.Load += new System.EventHandler(this.AttentionMapModule_Load);
      ((System.ComponentModel.ISupportInitialize)(this.bsoSubjects)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoFKSubjectsTrials)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.ogamaDataSet)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoFKTrialsEvents)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoTrialsAOIs)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoTrialsGazeFixations)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoTrialsMouseFixations)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoShapeGroups)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoFKSubjectsSubjectParameters)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoSubjectParameters)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoTrialEvents)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoTrials)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoGazeFixations)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoMouseFixations)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoAOIs)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.bsoParams)).EndInit();
      this.toolStripContainer1.ContentPanel.ResumeLayout(false);
      this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);
      this.toolStripContainer1.TopToolStripPanel.PerformLayout();
      this.toolStripContainer1.ResumeLayout(false);
      this.toolStripContainer1.PerformLayout();
      this.spcPictureGradient.Panel1.ResumeLayout(false);
      this.spcPictureGradient.Panel2.ResumeLayout(false);
      this.spcPictureGradient.ResumeLayout(false);
      this.spcPicAndList.Panel1.ResumeLayout(false);
      this.spcPicAndList.Panel2.ResumeLayout(false);
      this.spcPicAndList.ResumeLayout(false);
      this.toolStripContainer2.BottomToolStripPanel.ResumeLayout(false);
      this.toolStripContainer2.BottomToolStripPanel.PerformLayout();
      this.toolStripContainer2.ContentPanel.ResumeLayout(false);
      this.toolStripContainer2.ResumeLayout(false);
      this.toolStripContainer2.PerformLayout();
      this.toolStrip2.ResumeLayout(false);
      this.toolStrip2.PerformLayout();
      this.pnlCanvas.ResumeLayout(false);
      this.pnlPicture.ResumeLayout(false);
      this.tosTrial.ResumeLayout(false);
      this.tosTrial.PerformLayout();
      this.tosCalculation.ResumeLayout(false);
      this.tosCalculation.PerformLayout();
      this.ResumeLayout(false);

    }
コード例 #25
0
        private System.Drawing.Brush BrushToNativeBrush(Brush brush)
        {
            if (brush is SolidBrush)
            {
                return new System.Drawing.SolidBrush(ColorToNativeColor((brush as SolidBrush).Color));
            }
            else if (brush is LinearGradientBrush)
            {
                LinearGradientBrush b = (brush as LinearGradientBrush);
                System.Drawing.Drawing2D.LinearGradientBrush lgb = new System.Drawing.Drawing2D.LinearGradientBrush(RectangleToNativeRectangleF(b.Bounds), ColorToNativeColor(b.ColorStops[0].Color), ColorToNativeColor(b.ColorStops[b.ColorStops.Count - 1].Color), LinearGradientBrushOrientationToLinearGradientMode(b.Orientation));
                if (b.ColorStops.Count > 2)
                {
                    List<System.Drawing.Color> colorList = new List<System.Drawing.Color>();
                    List<float> positionList = new List<float>();

                    for (int i = 0; i < b.ColorStops.Count; i++)
                    {
                        colorList.Add(ColorToNativeColor(b.ColorStops[i].Color));
                        positionList.Add((float)(b.ColorStops[i].Position.ConvertTo(MeasurementUnit.Decimal).Value));
                    }

                    System.Drawing.Drawing2D.ColorBlend blend = new System.Drawing.Drawing2D.ColorBlend(b.ColorStops.Count);
                    blend.Colors = colorList.ToArray();
                    blend.Positions = positionList.ToArray();
                    lgb.InterpolationColors = blend;
                }
                return lgb;
            }
            return null;
        }
コード例 #26
0
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
      OgamaControls.Gradient gradient1 = new OgamaControls.Gradient();
      System.Drawing.Drawing2D.ColorBlend colorBlend1 = new System.Drawing.Drawing2D.ColorBlend();
      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ColorDefinitionDialog));
      this.splitContainer2 = new System.Windows.Forms.SplitContainer();
      this.trvSubjects = new System.Windows.Forms.TreeView();
      this.splitContainer1 = new System.Windows.Forms.SplitContainer();
      this.btnNumbersStyle = new System.Windows.Forms.Button();
      this.btnConnectionsStyle = new System.Windows.Forms.Button();
      this.btnFixationsStyle = new System.Windows.Forms.Button();
      this.panel1 = new System.Windows.Forms.Panel();
      this.pnlPreview = new System.Windows.Forms.Panel();
      this.splitContainer3 = new System.Windows.Forms.SplitContainer();
      this.rdbColorSubjects = new System.Windows.Forms.RadioButton();
      this.cbbPredefinedGradient = new System.Windows.Forms.ComboBox();
      this.rdbColorGroups = new System.Windows.Forms.RadioButton();
      this.label3 = new System.Windows.Forms.Label();
      this.rdbColorAutomatic = new System.Windows.Forms.RadioButton();
      this.label2 = new System.Windows.Forms.Label();
      this.label1 = new System.Windows.Forms.Label();
      this.spcGradientSingle = new System.Windows.Forms.SplitContainer();
      this.gradientControl = new OgamaControls.GradientTypeEditorUI();
      this.grpPreview = new System.Windows.Forms.GroupBox();
      this.spcPreview = new System.Windows.Forms.SplitContainer();
      this.btnOK = new System.Windows.Forms.Button();
      this.btnCancel = new System.Windows.Forms.Button();
      this.dialogTop1 = new DialogTop();
      this.splitContainer2.Panel1.SuspendLayout();
      this.splitContainer2.Panel2.SuspendLayout();
      this.splitContainer2.SuspendLayout();
      this.splitContainer1.Panel1.SuspendLayout();
      this.splitContainer1.Panel2.SuspendLayout();
      this.splitContainer1.SuspendLayout();
      this.panel1.SuspendLayout();
      this.splitContainer3.Panel1.SuspendLayout();
      this.splitContainer3.Panel2.SuspendLayout();
      this.splitContainer3.SuspendLayout();
      this.spcGradientSingle.Panel1.SuspendLayout();
      this.spcGradientSingle.Panel2.SuspendLayout();
      this.spcGradientSingle.SuspendLayout();
      this.grpPreview.SuspendLayout();
      this.spcPreview.Panel1.SuspendLayout();
      this.spcPreview.Panel2.SuspendLayout();
      this.spcPreview.SuspendLayout();
      this.SuspendLayout();
      // 
      // splitContainer2
      // 
      this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
      this.splitContainer2.Location = new System.Drawing.Point(0, 60);
      this.splitContainer2.Name = "splitContainer2";
      // 
      // splitContainer2.Panel1
      // 
      this.splitContainer2.Panel1.Controls.Add(this.trvSubjects);
      // 
      // splitContainer2.Panel2
      // 
      this.splitContainer2.Panel2.Controls.Add(this.splitContainer1);
      this.splitContainer2.Size = new System.Drawing.Size(719, 431);
      this.splitContainer2.SplitterDistance = 213;
      this.splitContainer2.TabIndex = 1;
      // 
      // trvSubjects
      // 
      this.trvSubjects.Dock = System.Windows.Forms.DockStyle.Fill;
      this.trvSubjects.DrawMode = System.Windows.Forms.TreeViewDrawMode.OwnerDrawText;
      this.trvSubjects.Location = new System.Drawing.Point(0, 0);
      this.trvSubjects.Name = "trvSubjects";
      this.trvSubjects.Size = new System.Drawing.Size(213, 431);
      this.trvSubjects.TabIndex = 1;
      this.trvSubjects.DrawNode += new System.Windows.Forms.DrawTreeNodeEventHandler(this.trvSubjects_DrawNode);
      this.trvSubjects.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.trvSubjects_AfterSelect);
      // 
      // splitContainer1
      // 
      this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
      this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
      this.splitContainer1.IsSplitterFixed = true;
      this.splitContainer1.Location = new System.Drawing.Point(0, 0);
      this.splitContainer1.Name = "splitContainer1";
      this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
      // 
      // splitContainer1.Panel1
      // 
      this.splitContainer1.Panel1.Controls.Add(this.splitContainer3);
      // 
      // splitContainer1.Panel2
      // 
      this.splitContainer1.Panel2.Controls.Add(this.btnOK);
      this.splitContainer1.Panel2.Controls.Add(this.btnCancel);
      this.splitContainer1.Panel2MinSize = 35;
      this.splitContainer1.Size = new System.Drawing.Size(502, 431);
      this.splitContainer1.SplitterDistance = 392;
      this.splitContainer1.TabIndex = 16;
      // 
      // btnNumbersStyle
      // 
      this.btnNumbersStyle.Image = global::Ogama.Properties.Resources.Color_fontHS;
      this.btnNumbersStyle.Location = new System.Drawing.Point(7, 65);
      this.btnNumbersStyle.Name = "btnNumbersStyle";
      this.btnNumbersStyle.Size = new System.Drawing.Size(122, 23);
      this.btnNumbersStyle.TabIndex = 0;
      this.btnNumbersStyle.Text = "Numbers style";
      this.btnNumbersStyle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
      this.btnNumbersStyle.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
      this.btnNumbersStyle.UseVisualStyleBackColor = true;
      this.btnNumbersStyle.Click += new System.EventHandler(this.btnNumbersStyle_Click);
      // 
      // btnConnectionsStyle
      // 
      this.btnConnectionsStyle.Image = global::Ogama.Properties.Resources.RPLFixConPen;
      this.btnConnectionsStyle.Location = new System.Drawing.Point(7, 36);
      this.btnConnectionsStyle.Name = "btnConnectionsStyle";
      this.btnConnectionsStyle.Size = new System.Drawing.Size(122, 23);
      this.btnConnectionsStyle.TabIndex = 0;
      this.btnConnectionsStyle.Text = "Connections style";
      this.btnConnectionsStyle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
      this.btnConnectionsStyle.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
      this.btnConnectionsStyle.UseVisualStyleBackColor = true;
      this.btnConnectionsStyle.Click += new System.EventHandler(this.btnConnectionsStyle_Click);
      // 
      // btnFixationsStyle
      // 
      this.btnFixationsStyle.Image = global::Ogama.Properties.Resources.RPLFixPen;
      this.btnFixationsStyle.Location = new System.Drawing.Point(7, 7);
      this.btnFixationsStyle.Name = "btnFixationsStyle";
      this.btnFixationsStyle.Size = new System.Drawing.Size(122, 23);
      this.btnFixationsStyle.TabIndex = 0;
      this.btnFixationsStyle.Text = "Fixations style";
      this.btnFixationsStyle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
      this.btnFixationsStyle.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
      this.btnFixationsStyle.UseVisualStyleBackColor = true;
      this.btnFixationsStyle.Click += new System.EventHandler(this.btnFixationsStyle_Click);
      // 
      // panel1
      // 
      this.panel1.Controls.Add(this.pnlPreview);
      this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
      this.panel1.Location = new System.Drawing.Point(0, 0);
      this.panel1.Name = "panel1";
      this.panel1.Size = new System.Drawing.Size(362, 94);
      this.panel1.TabIndex = 0;
      // 
      // pnlPreview
      // 
      this.pnlPreview.BackColor = System.Drawing.Color.White;
      this.pnlPreview.Dock = System.Windows.Forms.DockStyle.Top;
      this.pnlPreview.Location = new System.Drawing.Point(0, 0);
      this.pnlPreview.Name = "pnlPreview";
      this.pnlPreview.Size = new System.Drawing.Size(362, 90);
      this.pnlPreview.TabIndex = 0;
      this.pnlPreview.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlPreview_Paint);
      // 
      // splitContainer3
      // 
      this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
      this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
      this.splitContainer3.IsSplitterFixed = true;
      this.splitContainer3.Location = new System.Drawing.Point(0, 0);
      this.splitContainer3.Name = "splitContainer3";
      this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal;
      // 
      // splitContainer3.Panel1
      // 
      this.splitContainer3.Panel1.Controls.Add(this.rdbColorSubjects);
      this.splitContainer3.Panel1.Controls.Add(this.cbbPredefinedGradient);
      this.splitContainer3.Panel1.Controls.Add(this.rdbColorGroups);
      this.splitContainer3.Panel1.Controls.Add(this.label3);
      this.splitContainer3.Panel1.Controls.Add(this.rdbColorAutomatic);
      this.splitContainer3.Panel1.Controls.Add(this.label2);
      this.splitContainer3.Panel1.Controls.Add(this.label1);
      // 
      // splitContainer3.Panel2
      // 
      this.splitContainer3.Panel2.Controls.Add(this.spcGradientSingle);
      this.splitContainer3.Size = new System.Drawing.Size(502, 392);
      this.splitContainer3.SplitterDistance = 150;
      this.splitContainer3.TabIndex = 0;
      // 
      // rdbColorSubjects
      // 
      this.rdbColorSubjects.AutoSize = true;
      this.rdbColorSubjects.Location = new System.Drawing.Point(6, 3);
      this.rdbColorSubjects.Name = "rdbColorSubjects";
      this.rdbColorSubjects.Size = new System.Drawing.Size(219, 17);
      this.rdbColorSubjects.TabIndex = 0;
      this.rdbColorSubjects.Text = "Specify color for each subject separately.";
      this.rdbColorSubjects.UseVisualStyleBackColor = true;
      this.rdbColorSubjects.CheckedChanged += new System.EventHandler(this.rdbColorization_CheckedChanged);
      // 
      // cbbPredefinedGradient
      // 
      this.cbbPredefinedGradient.FormattingEnabled = true;
      this.cbbPredefinedGradient.Items.AddRange(new object[] {
            "Custom",
            "Traffic Light",
            "Rainbow"});
      this.cbbPredefinedGradient.Location = new System.Drawing.Point(272, 86);
      this.cbbPredefinedGradient.Name = "cbbPredefinedGradient";
      this.cbbPredefinedGradient.Size = new System.Drawing.Size(87, 21);
      this.cbbPredefinedGradient.TabIndex = 4;
      this.cbbPredefinedGradient.Text = "Custom";
      this.cbbPredefinedGradient.SelectionChangeCommitted += new System.EventHandler(this.cbbPredefinedGradient_SelectionChangeCommitted);
      // 
      // rdbColorGroups
      // 
      this.rdbColorGroups.AutoSize = true;
      this.rdbColorGroups.Location = new System.Drawing.Point(6, 46);
      this.rdbColorGroups.Name = "rdbColorGroups";
      this.rdbColorGroups.Size = new System.Drawing.Size(258, 17);
      this.rdbColorGroups.TabIndex = 0;
      this.rdbColorGroups.Text = "Specify a color for each subject group separately.";
      this.rdbColorGroups.UseVisualStyleBackColor = true;
      this.rdbColorGroups.CheckedChanged += new System.EventHandler(this.rdbColorization_CheckedChanged);
      // 
      // label3
      // 
      this.label3.AutoSize = true;
      this.label3.Location = new System.Drawing.Point(36, 107);
      this.label3.Name = "label3";
      this.label3.Size = new System.Drawing.Size(357, 13);
      this.label3.TabIndex = 2;
      this.label3.Text = "Please define the gradient below or select one of the predefined gradients.";
      // 
      // rdbColorAutomatic
      // 
      this.rdbColorAutomatic.AutoSize = true;
      this.rdbColorAutomatic.Checked = true;
      this.rdbColorAutomatic.Location = new System.Drawing.Point(6, 87);
      this.rdbColorAutomatic.Name = "rdbColorAutomatic";
      this.rdbColorAutomatic.Size = new System.Drawing.Size(243, 17);
      this.rdbColorAutomatic.TabIndex = 0;
      this.rdbColorAutomatic.TabStop = true;
      this.rdbColorAutomatic.Text = "Automatically colorize subjects with a gradient.";
      this.rdbColorAutomatic.UseVisualStyleBackColor = true;
      this.rdbColorAutomatic.CheckedChanged += new System.EventHandler(this.rdbColorization_CheckedChanged);
      // 
      // label2
      // 
      this.label2.AutoSize = true;
      this.label2.Location = new System.Drawing.Point(36, 66);
      this.label2.Name = "label2";
      this.label2.Size = new System.Drawing.Size(425, 13);
      this.label2.TabIndex = 2;
      this.label2.Text = "Please select a group and modify the color of its members by clicking on the colo" +
          "r button.";
      // 
      // label1
      // 
      this.label1.AutoSize = true;
      this.label1.Location = new System.Drawing.Point(36, 23);
      this.label1.Name = "label1";
      this.label1.Size = new System.Drawing.Size(348, 13);
      this.label1.TabIndex = 2;
      this.label1.Text = "Please select subject and modify its color by clicking on the color button.";
      // 
      // spcGradientSingle
      // 
      this.spcGradientSingle.Dock = System.Windows.Forms.DockStyle.Fill;
      this.spcGradientSingle.Location = new System.Drawing.Point(0, 0);
      this.spcGradientSingle.Name = "spcGradientSingle";
      this.spcGradientSingle.Orientation = System.Windows.Forms.Orientation.Horizontal;
      // 
      // spcGradientSingle.Panel1
      // 
      this.spcGradientSingle.Panel1.Controls.Add(this.gradientControl);
      // 
      // spcGradientSingle.Panel2
      // 
      this.spcGradientSingle.Panel2.Controls.Add(this.grpPreview);
      this.spcGradientSingle.Size = new System.Drawing.Size(502, 238);
      this.spcGradientSingle.SplitterDistance = 121;
      this.spcGradientSingle.TabIndex = 0;
      // 
      // gradientControl
      // 
      colorBlend1.Colors = new System.Drawing.Color[] {
        System.Drawing.Color.Transparent,
        System.Drawing.Color.Transparent};
      colorBlend1.Positions = new float[] {
        0F,
        1F};
      gradient1.ColorBlend = colorBlend1;
      gradient1.GradientDirection = System.Drawing.Drawing2D.LinearGradientMode.Horizontal;
      this.gradientControl.Gradient = gradient1;
      this.gradientControl.Location = new System.Drawing.Point(0, 0);
      this.gradientControl.Name = "gradientControl";
      this.gradientControl.Size = new System.Drawing.Size(502, 102);
      this.gradientControl.TabIndex = 0;
      this.gradientControl.GradientChanged += new System.EventHandler(this.gradientControl_GradientChanged);
      // 
      // grpPreview
      // 
      this.grpPreview.Controls.Add(this.spcPreview);
      this.grpPreview.Dock = System.Windows.Forms.DockStyle.Fill;
      this.grpPreview.Location = new System.Drawing.Point(0, 0);
      this.grpPreview.Name = "grpPreview";
      this.grpPreview.Size = new System.Drawing.Size(502, 113);
      this.grpPreview.TabIndex = 15;
      this.grpPreview.TabStop = false;
      this.grpPreview.Text = "Preview and modify custom style ...";
      // 
      // spcPreview
      // 
      this.spcPreview.Dock = System.Windows.Forms.DockStyle.Fill;
      this.spcPreview.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
      this.spcPreview.IsSplitterFixed = true;
      this.spcPreview.Location = new System.Drawing.Point(3, 16);
      this.spcPreview.Name = "spcPreview";
      // 
      // spcPreview.Panel1
      // 
      this.spcPreview.Panel1.Controls.Add(this.btnConnectionsStyle);
      this.spcPreview.Panel1.Controls.Add(this.btnFixationsStyle);
      this.spcPreview.Panel1.Controls.Add(this.btnNumbersStyle);
      // 
      // spcPreview.Panel2
      // 
      this.spcPreview.Panel2.Controls.Add(this.panel1);
      this.spcPreview.Size = new System.Drawing.Size(496, 94);
      this.spcPreview.SplitterDistance = 130;
      this.spcPreview.TabIndex = 1;
      // 
      // btnOK
      // 
      this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
      this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
      this.btnOK.Location = new System.Drawing.Point(343, 3);
      this.btnOK.Name = "btnOK";
      this.btnOK.Size = new System.Drawing.Size(75, 23);
      this.btnOK.TabIndex = 3;
      this.btnOK.Text = "&OK";
      this.btnOK.UseVisualStyleBackColor = true;
      // 
      // btnCancel
      // 
      this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
      this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
      this.btnCancel.Location = new System.Drawing.Point(424, 4);
      this.btnCancel.Name = "btnCancel";
      this.btnCancel.Size = new System.Drawing.Size(75, 23);
      this.btnCancel.TabIndex = 3;
      this.btnCancel.Text = "&Cancel";
      this.btnCancel.UseVisualStyleBackColor = true;
      // 
      // dialogTop1
      // 
      this.dialogTop1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(237)))), ((int)(((byte)(237)))));
      this.dialogTop1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("dialogTop1.BackgroundImage")));
      this.dialogTop1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
      this.dialogTop1.Description = "Please specify how to colorize the subjects scanpaths.";
      this.dialogTop1.Dock = System.Windows.Forms.DockStyle.Top;
      this.dialogTop1.Location = new System.Drawing.Point(0, 0);
      this.dialogTop1.Logo = global::Ogama.Properties.Resources.DisplayInColorHS;
      this.dialogTop1.Name = "dialogTop1";
      this.dialogTop1.Size = new System.Drawing.Size(719, 60);
      this.dialogTop1.TabIndex = 2;
      // 
      // ColorDefinitionDialog
      // 
      this.AcceptButton = this.btnOK;
      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
      this.CancelButton = this.btnCancel;
      this.ClientSize = new System.Drawing.Size(719, 491);
      this.Controls.Add(this.splitContainer2);
      this.Controls.Add(this.dialogTop1);
      this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
      this.Name = "ColorDefinitionDialog";
      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
      this.Text = "Define color range for the subjects.";
      this.splitContainer2.Panel1.ResumeLayout(false);
      this.splitContainer2.Panel2.ResumeLayout(false);
      this.splitContainer2.ResumeLayout(false);
      this.splitContainer1.Panel1.ResumeLayout(false);
      this.splitContainer1.Panel2.ResumeLayout(false);
      this.splitContainer1.ResumeLayout(false);
      this.panel1.ResumeLayout(false);
      this.splitContainer3.Panel1.ResumeLayout(false);
      this.splitContainer3.Panel1.PerformLayout();
      this.splitContainer3.Panel2.ResumeLayout(false);
      this.splitContainer3.ResumeLayout(false);
      this.spcGradientSingle.Panel1.ResumeLayout(false);
      this.spcGradientSingle.Panel2.ResumeLayout(false);
      this.spcGradientSingle.ResumeLayout(false);
      this.grpPreview.ResumeLayout(false);
      this.spcPreview.Panel1.ResumeLayout(false);
      this.spcPreview.Panel2.ResumeLayout(false);
      this.spcPreview.ResumeLayout(false);
      this.ResumeLayout(false);

    }
コード例 #27
0
        /// <summary>
        /// Repaints the form with cool background and stuff
        /// </summary>
        /// <param name="graph">The graphics object to paint to, the element will be drawn to 0,0</param>
        public virtual void Paint(Graphics graph)
        {
            //Sets up the colors to use
            Pen outlinePen = new Pen(MapWindow.Main.Global.ColorFromHSL(Color.GetHue(), Color.GetSaturation(), Color.GetBrightness() * 0.6 * Highlight), 1.75F);
            Color gradientTop = MapWindow.Main.Global.ColorFromHSL(Color.GetHue(), Color.GetSaturation(), Color.GetBrightness() * 0.7 * Highlight);
            Color gradientBottom = MapWindow.Main.Global.ColorFromHSL(Color.GetHue(), Color.GetSaturation(), Color.GetBrightness() * 1.0 * Highlight);

            //The path used for drop shadows
            System.Drawing.Drawing2D.GraphicsPath shadowPath = new System.Drawing.Drawing2D.GraphicsPath();
            System.Drawing.Drawing2D.ColorBlend colorBlend = new System.Drawing.Drawing2D.ColorBlend(3);
            colorBlend.Colors = new Color[] { Color.Transparent, Color.FromArgb(180, Color.DarkGray), Color.FromArgb(180, Color.DimGray) };
            colorBlend.Positions = new float[] { 0f, 0.125f,1f};

            //Draws Rectangular Shapes
            if (Shape == ModelShapes.Rectangle)
            {
                //Draws the shadow
                shadowPath.AddPath(GetRoundedRect(new Rectangle(5, 5, this.Width, this.Height), 10), true);
                System.Drawing.Drawing2D.PathGradientBrush shadowBrush = new System.Drawing.Drawing2D.PathGradientBrush(shadowPath);
                shadowBrush.WrapMode = System.Drawing.Drawing2D.WrapMode.Clamp;
                shadowBrush.InterpolationColors = colorBlend;
                graph.FillPath(shadowBrush, shadowPath);

                //Draws the basic shape
                System.Drawing.Rectangle fillRectange = new Rectangle(0, 0, this.Width - 5, this.Height - 5);
                System.Drawing.Drawing2D.GraphicsPath fillArea = GetRoundedRect(fillRectange, 5);
                System.Drawing.Drawing2D.LinearGradientBrush myBrush = new System.Drawing.Drawing2D.LinearGradientBrush(fillRectange, gradientBottom, gradientTop, System.Drawing.Drawing2D.LinearGradientMode.Vertical);
                graph.FillPath(myBrush, fillArea);
                graph.DrawPath(outlinePen, fillArea);
                
                //Draws the status light
                drawStatusLight(graph);
                
                //Draws the text
                SizeF textSize = graph.MeasureString(Name, Font, this.Width);
                RectangleF textRect;
                if ((textSize.Width < this.Width) || (textSize.Height < this.Height))
                    textRect = new RectangleF((this.Width - textSize.Width) / 2, (this.Height - textSize.Height) / 2, textSize.Width, textSize.Height);
                else
                    textRect = new RectangleF(0, (this.Height - textSize.Height) / 2, this.Width, textSize.Height);
                graph.DrawString(Name, Font, new SolidBrush(Color.FromArgb(50, Color.Black)), textRect);
                textRect.X = textRect.X - 1;
                textRect.Y = textRect.Y - 1;
                graph.DrawString(Name, Font, System.Drawing.Brushes.Black, textRect);

                //Garbage collection
                fillArea.Dispose();
                myBrush.Dispose();
            }

            //Draws Ellipse Shapes
            if (_shape == ModelShapes.Ellipse)
            {
                //Draws the shadow
                shadowPath.AddEllipse(0, 5, this.Width+5, this.Height);
                System.Drawing.Drawing2D.PathGradientBrush shadowBrush = new System.Drawing.Drawing2D.PathGradientBrush(shadowPath);
                shadowBrush.WrapMode = System.Drawing.Drawing2D.WrapMode.Clamp;
                shadowBrush.InterpolationColors = colorBlend;
                graph.FillPath(shadowBrush, shadowPath);

                //Draws the Ellipse
                System.Drawing.Rectangle fillArea = new Rectangle(0, 0, this.Width, this.Height);
                System.Drawing.Drawing2D.LinearGradientBrush myBrush = new System.Drawing.Drawing2D.LinearGradientBrush(fillArea, gradientBottom, gradientTop, System.Drawing.Drawing2D.LinearGradientMode.Vertical);
                graph.FillEllipse(myBrush, 1, 1, this.Width - 5, this.Height - 5);
                graph.DrawEllipse(outlinePen, 1, 1, this.Width - 5, this.Height - 5);

                //Draws the text
                SizeF textSize = graph.MeasureString(_name, _font, this.Width);
                RectangleF textRect;
                if ((textSize.Width < this.Width) || (textSize.Height < this.Height))
                    textRect = new RectangleF((this.Width - textSize.Width) / 2, (this.Height - textSize.Height) / 2, textSize.Width, textSize.Height);
                else
                    textRect = new RectangleF(0, (this.Height - textSize.Height) / 2, this.Width, textSize.Height);
                graph.DrawString(Name, Font, new SolidBrush(Color.FromArgb(50, Color.Black)), textRect);
                textRect.X = textRect.X - 1;
                textRect.Y = textRect.Y - 1;
                graph.DrawString(Name, Font, System.Drawing.Brushes.Black, textRect);

                //Garbage collection
                myBrush.Dispose();
            }

            //Draws Triangular Shapes
            if (_shape == ModelShapes.Triangle)
            {
                //Draws the shadow
                Point[] ptShadow = new Point[4];
                ptShadow[0] = new Point(5, 5);
                ptShadow[1] = new Point(this.Width + 5, ((this.Height - 5) / 2) + 5);
                ptShadow[2] = new Point(5, this.Height+2);
                ptShadow[3] = new Point(5, 5);
                shadowPath.AddLines(ptShadow);
                System.Drawing.Drawing2D.PathGradientBrush shadowBrush = new System.Drawing.Drawing2D.PathGradientBrush(shadowPath);
                shadowBrush.WrapMode = System.Drawing.Drawing2D.WrapMode.Clamp;
                shadowBrush.InterpolationColors = colorBlend;
                graph.FillPath(shadowBrush, shadowPath);

                //Draws the shape
                Point[] pt = new Point[4];
                pt[0] = new Point(0, 0);
                pt[1] = new Point(this.Width - 5, (this.Height-5) / 2);
                pt[2] = new Point(0, this.Height-5);
                pt[3] = new Point(0, 0);
                System.Drawing.Drawing2D.GraphicsPath myPath = new System.Drawing.Drawing2D.GraphicsPath();
                myPath.AddLines(pt);
                System.Drawing.Rectangle fillArea = new Rectangle(1, 1, this.Width - 5, this.Height - 5);
                System.Drawing.Drawing2D.LinearGradientBrush myBrush = new System.Drawing.Drawing2D.LinearGradientBrush(fillArea, gradientBottom, gradientTop, System.Drawing.Drawing2D.LinearGradientMode.Vertical);
                graph.FillPath(myBrush, myPath);
                graph.DrawPath(outlinePen, myPath);

                //Draws the text
                SizeF textSize = graph.MeasureString(Name, Font, this.Width);
                RectangleF textRect;
                if ((textSize.Width < this.Width) || (textSize.Height < this.Height))
                    textRect = new RectangleF((this.Width - textSize.Width) / 2, (this.Height - textSize.Height) / 2, textSize.Width, textSize.Height);
                else
                    textRect = new RectangleF(0, (this.Height - textSize.Height) / 2, this.Width, textSize.Height);
                graph.DrawString(Name, Font, System.Drawing.Brushes.Black, textRect);

                //Garbage collection
                myBrush.Dispose();
            }
            
            //Garbage collection
            shadowPath.Dispose();
            outlinePen.Dispose();
        }
コード例 #28
0
ファイル: BitmapButton.cs プロジェクト: mahitosh/HRA4
        /// <summary>
        /// Paints a border around the image. If Image drop shadow is enabled,
        /// a shodow is drawn too.
        /// </summary>
        /// <param name="g">The graphics object</param>
        /// <param name="ImageRect">the rectangle region of the image</param>
        private void paint_ImageBorder(System.Drawing.Graphics g, System.Drawing.Rectangle ImageRect)
        {
            System.Drawing.Rectangle rect = ImageRect;

            //
            // If ImageDropShadow = true, draw shadow
            //
            if (ImageDropShadow)
            {
                System.Drawing.Pen p0 = new System.Drawing.Pen(System.Drawing.Color.FromArgb(80, 0, 0, 0));
                System.Drawing.Pen p1 = new System.Drawing.Pen(System.Drawing.Color.FromArgb(40, 0, 0, 0));
                g.DrawLine(p0, new Point(rect.Right, rect.Bottom), new Point(rect.Right + 1, rect.Bottom));
                g.DrawLine(p0, new Point(rect.Right + 1, rect.Top + 1), new Point(rect.Right + 1, rect.Bottom + 0));
                g.DrawLine(p1, new Point(rect.Right + 2, rect.Top + 2), new Point(rect.Right + 2, rect.Bottom + 1));
                g.DrawLine(p0, new Point(rect.Left + 1, rect.Bottom + 1), new Point(rect.Right + 0, rect.Bottom + 1));
                g.DrawLine(p1, new Point(rect.Left + 1, rect.Bottom + 2), new Point(rect.Right + 1, rect.Bottom + 2));
            }
            //
            // Draw Image Border
            //
            if (ImageBorderEnabled)
            {
                Color[] ColorArray         = null;
                float[] PositionArray      = null;
                System.Drawing.Color color = this.ImageBorderColor;
                if (!this.Enabled)
                {
                    color = System.Drawing.Color.LightGray;
                }
                //
                // initialize color and position array
                //
                ColorArray = new Color[] {
                    Blend(color, System.Drawing.Color.White, 40),
                    Blend(color, System.Drawing.Color.White, 20),
                    Blend(color, System.Drawing.Color.White, 30),
                    Blend(color, System.Drawing.Color.White, 00),
                    Blend(color, System.Drawing.Color.Black, 30),
                    Blend(color, System.Drawing.Color.Black, 70),
                };
                PositionArray = new float[] { 0.0f, .20f, .50f, .60f, .90f, 1.0f };
                //
                // create blend object
                //
                System.Drawing.Drawing2D.ColorBlend blend = new System.Drawing.Drawing2D.ColorBlend();
                blend.Colors    = ColorArray;
                blend.Positions = PositionArray;
                //
                // create brush and pens
                //
                System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(rect, this.BackColor, Blend(this.BackColor, this.BackColor, 10), System.Drawing.Drawing2D.LinearGradientMode.Vertical);
                brush.InterpolationColors = blend;
                System.Drawing.Pen pen0 = new System.Drawing.Pen(brush, 1);
                System.Drawing.Pen pen1 = new System.Drawing.Pen(System.Drawing.Color.Black);
                //
                // calculate points to draw line
                //
                rect.Inflate(1, 1);
                Point[] pts = border_Get(rect.Left, rect.Top, rect.Width, rect.Height);
                this.border_Contract(1, ref pts);
                //
                // draw line 0
                //
                g.DrawLines(pen1, pts);
                //
                // draw line 1
                //
                this.border_Contract(1, ref pts);
                g.DrawLines(pen0, pts);
                //
                // release resources
                //
                pen1.Dispose();
                pen0.Dispose();
                brush.Dispose();
            }
        }
コード例 #29
0
ファイル: BitmapButton.cs プロジェクト: mahitosh/HRA4
        /// <summary>
        /// This method fills the background of the button.
        /// </summary>
        /// <param name="e">paint arguments use to paint the button</param>
        private void paint_Background(PaintEventArgs e)
        {
            if (e == null)
            {
                return;
            }
            if (e.Graphics == null)
            {
                return;
            }

            Graphics g = e.Graphics;

            System.Drawing.Rectangle rect = new Rectangle(0, 0, Size.Width, Size.Height);
            //
            // get color of background
            //
            System.Drawing.Color color = this.BackColor;;
            if (btnState == BtnState.Inactive)
            {
                color = System.Drawing.Color.LightGray;
            }
            //
            // intialize ColorArray and Positions Array
            //
            Color[] ColorArray    = null;
            float[] PositionArray = null;
            //
            // initialize color array for a button that is pushed
            //
            if (btnState == BtnState.Pushed)
            {
                ColorArray = new Color[] {
                    Blend(this.BackColor, System.Drawing.Color.White, 80),
                    Blend(this.BackColor, System.Drawing.Color.White, 40),
                    Blend(this.BackColor, System.Drawing.Color.Black, 0),
                    Blend(this.BackColor, System.Drawing.Color.Black, 0),
                    Blend(this.BackColor, System.Drawing.Color.White, 40),
                    Blend(this.BackColor, System.Drawing.Color.White, 80),
                };
                PositionArray = new float[] { 0.0f, .05f, .40f, .60f, .95f, 1.0f };
            }
            //
            // else, initialize color array for a button that is normal or disabled
            //
            else
            {
                ColorArray = new Color[] {
                    Blend(color, System.Drawing.Color.White, 80),
                    Blend(color, System.Drawing.Color.White, 90),
                    Blend(color, System.Drawing.Color.White, 30),
                    Blend(color, System.Drawing.Color.White, 00),
                    Blend(color, System.Drawing.Color.Black, 30),
                    Blend(color, System.Drawing.Color.Black, 20),
                };
                PositionArray = new float[] { 0.0f, .15f, .40f, .65f, .80f, 1.0f };
            }
            //
            // create blend variable for the interpolate the colors
            //
            System.Drawing.Drawing2D.ColorBlend blend = new System.Drawing.Drawing2D.ColorBlend();
            blend.Colors    = ColorArray;
            blend.Positions = PositionArray;
            //
            // create vertical gradient brush
            //
            System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(rect, this.BackColor, Blend(this.BackColor, this.BackColor, 10), System.Drawing.Drawing2D.LinearGradientMode.Vertical);
            brush.InterpolationColors = blend;
            //
            // fill the rectangle
            //
            g.FillRectangle(brush, rect);
            //
            // release resources
            //
            brush.Dispose();
        }
コード例 #30
0
 private ColorBlend(System.Drawing.Drawing2D.ColorBlend colorBlend)
 {
     WrappedColorBlend = colorBlend;
 }
コード例 #31
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.Drawing.Drawing2D.ColorBlend colorBlend1 = new System.Drawing.Drawing2D.ColorBlend();
     this.colorGradientEditor = new Zeroit.Framework.ListView.Editors.ColorGradientEditor();
     this.splitter            = new System.Windows.Forms.SplitContainer();
     this.cancelButton        = new System.Windows.Forms.Button();
     this.okButton            = new System.Windows.Forms.Button();
     this.panel1  = new System.Windows.Forms.Panel();
     this.button1 = new System.Windows.Forms.Button();
     ((System.ComponentModel.ISupportInitialize)(this.splitter)).BeginInit();
     this.splitter.Panel1.SuspendLayout();
     this.splitter.Panel2.SuspendLayout();
     this.splitter.SuspendLayout();
     this.panel1.SuspendLayout();
     this.SuspendLayout();
     //
     // colorGradientEditor
     //
     this.colorGradientEditor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56)))));
     colorBlend1.Colors = new System.Drawing.Color[] {
         System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))),
         System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(0)))), ((int)(((byte)(128)))), ((int)(((byte)(0))))),
         System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(255)))))
     };
     colorBlend1.Positions = new float[] {
         0F,
         0.5F,
         1F
     };
     this.colorGradientEditor.Blend               = colorBlend1;
     this.colorGradientEditor.Dock                = System.Windows.Forms.DockStyle.Fill;
     this.colorGradientEditor.GradientBackColor   = System.Drawing.Color.White;
     this.colorGradientEditor.GradientBorderColor = System.Drawing.Color.DarkGray;
     this.colorGradientEditor.GradientHatchColor  = System.Drawing.Color.Black;
     this.colorGradientEditor.Location            = new System.Drawing.Point(0, 0);
     this.colorGradientEditor.MarkerBorderColor   = System.Drawing.Color.Black;
     this.colorGradientEditor.MarkerFillColor     = System.Drawing.Color.White;
     this.colorGradientEditor.MinimumSize         = new System.Drawing.Size(322, 120);
     this.colorGradientEditor.Name                = "colorGradientEditor";
     this.colorGradientEditor.SelMarkerFillColor  = System.Drawing.Color.Yellow;
     this.colorGradientEditor.Size                = new System.Drawing.Size(374, 169);
     this.colorGradientEditor.TabIndex            = 0;
     this.colorGradientEditor.Load               += new System.EventHandler(this.colorGradientEditor_Load);
     //
     // splitter
     //
     this.splitter.Dock            = System.Windows.Forms.DockStyle.Bottom;
     this.splitter.FixedPanel      = System.Windows.Forms.FixedPanel.Panel2;
     this.splitter.IsSplitterFixed = true;
     this.splitter.Location        = new System.Drawing.Point(8, 38);
     this.splitter.Name            = "splitter";
     this.splitter.Orientation     = System.Windows.Forms.Orientation.Horizontal;
     //
     // splitter.Panel1
     //
     this.splitter.Panel1.Controls.Add(this.colorGradientEditor);
     //
     // splitter.Panel2
     //
     this.splitter.Panel2.Controls.Add(this.cancelButton);
     this.splitter.Panel2.Controls.Add(this.okButton);
     this.splitter.Size             = new System.Drawing.Size(374, 198);
     this.splitter.SplitterDistance = 169;
     this.splitter.TabIndex         = 1;
     //
     // cancelButton
     //
     this.cancelButton.BackColor    = System.Drawing.Color.SlateGray;
     this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     this.cancelButton.FlatAppearance.BorderSize = 0;
     this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.cancelButton.ForeColor = System.Drawing.SystemColors.HighlightText;
     this.cancelButton.Location  = new System.Drawing.Point(80, 0);
     this.cancelButton.Name      = "cancelButton";
     this.cancelButton.Size      = new System.Drawing.Size(75, 24);
     this.cancelButton.TabIndex  = 1;
     this.cancelButton.Text      = "Cancel";
     this.cancelButton.UseVisualStyleBackColor = false;
     this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
     //
     // okButton
     //
     this.okButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(122)))), ((int)(((byte)(204)))));
     this.okButton.FlatAppearance.BorderSize = 0;
     this.okButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.okButton.ForeColor = System.Drawing.SystemColors.HighlightText;
     this.okButton.Location  = new System.Drawing.Point(0, 0);
     this.okButton.Name      = "okButton";
     this.okButton.Size      = new System.Drawing.Size(75, 24);
     this.okButton.TabIndex  = 0;
     this.okButton.Text      = "OK";
     this.okButton.UseVisualStyleBackColor = false;
     this.okButton.Click += new System.EventHandler(this.okButton_Click);
     //
     // panel1
     //
     this.panel1.Controls.Add(this.button1);
     this.panel1.Dock     = System.Windows.Forms.DockStyle.Top;
     this.panel1.Location = new System.Drawing.Point(8, 8);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(374, 24);
     this.panel1.TabIndex = 2;
     //
     // button1
     //
     this.button1.BackColor = System.Drawing.Color.Red;
     this.button1.FlatAppearance.BorderSize = 0;
     this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.button1.Font      = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.button1.ForeColor = System.Drawing.SystemColors.Control;
     this.button1.Location  = new System.Drawing.Point(353, 1);
     this.button1.Name      = "button1";
     this.button1.Size      = new System.Drawing.Size(18, 21);
     this.button1.TabIndex  = 0;
     this.button1.Text      = "x";
     this.button1.UseVisualStyleBackColor = false;
     //
     // ColorGradientEditorDialog
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.BackColor           = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(22)))), ((int)(((byte)(22)))));
     this.CancelButton        = this.cancelButton;
     this.ClientSize          = new System.Drawing.Size(390, 244);
     this.Controls.Add(this.panel1);
     this.Controls.Add(this.splitter);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     this.MaximizeBox     = false;
     this.MinimizeBox     = false;
     this.MinimumSize     = new System.Drawing.Size(356, 200);
     this.Name            = "ColorGradientEditorDialog";
     this.Padding         = new System.Windows.Forms.Padding(8);
     this.Text            = "Color Gradient Editor";
     this.splitter.Panel1.ResumeLayout(false);
     this.splitter.Panel2.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.splitter)).EndInit();
     this.splitter.ResumeLayout(false);
     this.panel1.ResumeLayout(false);
     this.ResumeLayout(false);
 }
コード例 #32
0
        private void PaintGradient()
        {
            string strBMPath = string.Empty;
            System.Drawing.Drawing2D.LinearGradientBrush gradBrushButton;
            Graphics grObject;
            System.Drawing.Drawing2D.ColorBlend clrblend = null;
            Rectangle objrect;
            Bitmap objbmp = null;
            try
            {
                Color[] clrSet = new Color[4]{   
                                    //Color.Silver,                                                                        
                                    //Color.SeaShell,
                                    //Color.WhiteSmoke,
                                    //Color.White};
                                    Color.FromArgb(119,187,255),                                                                        
                                     Color.FromArgb(210,232,255),
                                     Color.FromArgb(232,244,255),
                                    Color.FromArgb(255,255,255)};
                clrblend = new System.Drawing.Drawing2D.ColorBlend();
                clrblend.Colors = clrSet;
                Single[] bPts = new Single[4]{
                                            0,                                          
                                            0.5F,
                                            0.8F,                                          
                                            1};
                clrblend.Positions = bPts;
                gradBrushButton = new System.Drawing.Drawing2D.LinearGradientBrush(new
                       Point(0, 0), new Point(this.Width, this.Height), Color.FromArgb(217,230,255), Color.White);
                gradBrushButton.InterpolationColors = clrblend;
                objrect = new Rectangle(0, 0, this.Width, this.Height);               
                objbmp = new Bitmap(this.Width, this.Height);
                //}

                grObject = Graphics.FromImage(objbmp);
                grObject.FillRectangle(gradBrushButton, objrect);

                btnExchangeTestConnection.BackgroundImage = objbmp;
                btnSaveExchangeConnection.BackgroundImage = objbmp;
                btnexchangeDBRestore.BackgroundImage = objbmp;
                btnDSNSave.BackgroundImage = objbmp;
                btnTicketingTestConnection.BackgroundImage = objbmp;
                btnTicketDBRestore.BackgroundImage = objbmp;
                btnCMPGatewayTestConnection.BackgroundImage = objbmp;
                btnCMPGatewaySaveChanges.BackgroundImage = objbmp;
                btnTestURL.BackgroundImage = objbmp;
                btnCreateMSMQ.BackgroundImage = objbmp;
                btnStartService.BackgroundImage = objbmp;
                btnEndService.BackgroundImage = objbmp;
                btnRefreshServices.BackgroundImage = objbmp;
                btnSaveSettings.BackgroundImage = objbmp;
                btnRunUpgradeScript.BackgroundImage = objbmp;
                btnExit.BackgroundImage = objbmp;
                btnSelectAll.BackgroundImage = objbmp;
                btnExchangeTestConnection.BackgroundImageLayout = ImageLayout.Stretch;
                btnSaveExchangeConnection.BackgroundImageLayout = ImageLayout.Stretch;
                btnDSNSave.BackgroundImageLayout = ImageLayout.Stretch;
                btnexchangeDBRestore.BackgroundImageLayout = ImageLayout.Stretch;
                btnTicketingTestConnection.BackgroundImageLayout = ImageLayout.Stretch;
                btnTicketDBRestore.BackgroundImageLayout = ImageLayout.Stretch;
                btnCMPGatewayTestConnection.BackgroundImageLayout = ImageLayout.Stretch;
                btnCMPGatewaySaveChanges.BackgroundImageLayout = ImageLayout.Stretch;
                btnTestURL.BackgroundImageLayout = ImageLayout.Stretch;
                btnCreateMSMQ.BackgroundImageLayout = ImageLayout.Stretch;
                btnStartService.BackgroundImageLayout = ImageLayout.Stretch;
                btnEndService.BackgroundImageLayout = ImageLayout.Stretch;
                btnRefreshServices.BackgroundImageLayout = ImageLayout.Stretch;
                btnSaveSettings.BackgroundImageLayout = ImageLayout.Stretch;
                btnRunUpgradeScript.BackgroundImageLayout = ImageLayout.Stretch;
                btnExit.BackgroundImageLayout = ImageLayout.Stretch;
                btnSelectAll.BackgroundImageLayout = ImageLayout.Stretch; ;
                panel1.BackgroundImage = objbmp;
                panel1.BackgroundImageLayout = ImageLayout.Stretch;

                //lvServiceslist.BackgroundImage = objbmp;
                //lvServiceslist.BackgroundImageLayout = ImageLayout.Stretch;
                lvServiceslist.BackColor = Color.White;
                cmbLanIP.BackColor = Color.White;
                cmbSlotLan.BackColor = Color.White;
            }
            catch (Exception ex)
            {
                LogManager.WriteLog("PaintGradient:  " + ex.Message.ToString() + ex.Source.ToString(), LogManager.enumLogLevel.Error);
                ExceptionManager.Publish(ex);
            }
        }
コード例 #33
0
ファイル: BitmapButton.cs プロジェクト: unieagle/libpalaso
		/// <summary>
		/// paint the inner border of the button.
		/// </summary>
		/// <param name="e">paint arguments use to paint the button</param>
		private void paint_InnerBorder(PaintEventArgs e)
		{
			if(e == null)
				return;
			if(e.Graphics == null)
				return;

#if ENABLE_BITMAPBUTTON_PAINT_INNERBORDER
			Graphics g = e.Graphics;
			System.Drawing.Rectangle rect = new Rectangle(0,0,Size.Width,Size.Height);

			System.Drawing.Color color = this.BackColor;
			//
			// get color of inner border
			//
			switch(State)
			{
				case BtnState.Inactive:
					color = System.Drawing.Color.Gray;
					break;
				case BtnState.Normal:
					if(this.Focused)
						color = this.InnerBorderColor_Focus;
					else
						color = this.InnerBorderColor;
					break;
				case BtnState.Pushed:
					color = Blend(InnerBorderColor_Focus,System.Drawing.Color.Black,10);
					break;
				case BtnState.MouseOver:
					color = InnerBorderColor_MouseOver;
					break;
			}
			//
			// populate color and position arrays
			//
			Color[] ColorArray    = null;
			float[] PositionArray = null;
			if(State == BtnState.Pushed)
			{
				ColorArray = new System.Drawing.Color [] {
									   Blend(color,System.Drawing.Color.Black,20),
									   Blend(color,System.Drawing.Color.Black,10),
									   Blend(color,System.Drawing.Color.White,00),
									   Blend(color,System.Drawing.Color.White,50),
									   Blend(color,System.Drawing.Color.White,85),
									   Blend(color,System.Drawing.Color.White,90),
				};
				PositionArray = new float[] {0.0f,.20f,.50f,.60f,.90f,1.0f};
			}
			else
			{
				ColorArray = new System.Drawing.Color [] {
									   Blend(color,System.Drawing.Color.White,80),
									   Blend(color,System.Drawing.Color.White,60),
									   Blend(color,System.Drawing.Color.White,10),
									   Blend(color,System.Drawing.Color.White,00),
									   Blend(color,System.Drawing.Color.Black,20),
									   Blend(color,System.Drawing.Color.Black,50),
				};
				PositionArray = new float[] {0.0f,.20f,.50f,.60f,.90f,1.0f};
			}
			//
			// create blend object
			//
			System.Drawing.Drawing2D.ColorBlend blend = new System.Drawing.Drawing2D.ColorBlend();
			blend.Colors    = ColorArray;
			blend.Positions = PositionArray;
			//
			// create gradient brush and pen
			//
			System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(rect, this.BackColor,Blend(this.BackColor,this.BackColor,10), System.Drawing.Drawing2D.LinearGradientMode.Vertical);
			brush.InterpolationColors = blend;
			System.Drawing.Pen pen0 = new System.Drawing.Pen(brush,1);
			//
			// get points array to draw the line
			//
			Point[] pts = border_Get(0,0,this.Width-1,this.Height-1);
			//
			// draw line 0
			//
			this.border_Contract(1,ref pts);
			e.Graphics.DrawLines(pen0,pts);
			//
			// draw line 1
			//
			this.border_Contract(1,ref pts);
			e.Graphics.DrawLines(pen0,pts);
			//
			// release resources
			//
			pen0.Dispose();
			brush.Dispose();
#endif
		}
コード例 #34
0
        public override void RenderCustomChart(Character character, string chartName, System.Drawing.Graphics g, int width, int height)
        {
            Rectangle rectSubPoint;
            System.Drawing.Drawing2D.LinearGradientBrush brushSubPointFill;
            System.Drawing.Drawing2D.ColorBlend blendSubPoint;

            CalculationOptionsMage calculationOptions = character.CalculationOptions as CalculationOptionsMage;

            Font fontLegend = new Font("Verdana", 10f, GraphicsUnit.Pixel);
            int legendY;

            Brush[] brushSubPoints;
            Color[] colorSubPointsA;
            Color[] colorSubPointsB;

            float graphStart;
            float graphWidth;
            float graphTop;
            float graphBottom;
            float graphHeight;
            float maxScale;
            float graphEnd;
            float[] ticks;
            Pen black200 = new Pen(Color.FromArgb(200, 0, 0, 0));
            Pen black150 = new Pen(Color.FromArgb(150, 0, 0, 0));
            Pen black75 = new Pen(Color.FromArgb(75, 0, 0, 0));
            Pen black50 = new Pen(Color.FromArgb(50, 0, 0, 0));
            Pen black25 = new Pen(Color.FromArgb(25, 0, 0, 0));
            StringFormat formatTick = new StringFormat();
            formatTick.LineAlignment = StringAlignment.Far;
            formatTick.Alignment = StringAlignment.Center;
            Brush black200brush = new SolidBrush(Color.FromArgb(200, 0, 0, 0));
            Brush black150brush = new SolidBrush(Color.FromArgb(150, 0, 0, 0));
            Brush black75brush = new SolidBrush(Color.FromArgb(75, 0, 0, 0));
            Brush black50brush = new SolidBrush(Color.FromArgb(50, 0, 0, 0));
            Brush black25brush = new SolidBrush(Color.FromArgb(25, 0, 0, 0));

            string[] statNames = new string[] { "11.7 Spell Power", "4 Mana per 5 sec", "10 Crit Rating", "10 Haste Rating", "10 Hit Rating", "10 Intellect", "10 Spirit" };
            Color[] statColors = new Color[] { Color.FromArgb(255, 255, 0, 0), Color.DarkBlue, Color.FromArgb(255, 255, 165, 0), Color.Olive, Color.FromArgb(255, 154, 205, 50), Color.Aqua, Color.FromArgb(255, 0, 0, 255) };

            DisplayCalculations calculations = calculationOptions.Calculations;

            List<float> X = new List<float>();
            List<ComparisonCalculationBase[]> Y = new List<ComparisonCalculationBase[]>();

            height -= 2;

            Stats[] statsList = new Stats[] {
                        new Stats() { SpellPower = 1.17f },
                        new Stats() { Mp5 = 0.4f },
                        new Stats() { CritRating = 1 },
                        new Stats() { HasteRating = 1 },
                        new Stats() { HitRating = 1 },
                        new Stats() { Intellect = 1 },
                        new Stats() { Spirit = 1 },
                    };

            switch (chartName)
            {
                case "Stats Graph":
                    Base.Graph.RenderStatsGraph(g, width, height, character, statsList, statColors, 100, "", "Dps Rating", Base.Graph.Style.Mage);
                    break;
                case "Proc Uptime":
                    List<SpecialEffect> effectList = new List<SpecialEffect>();
                    effectList.AddRange(calculations.SpellPowerEffects);
                    effectList.AddRange(calculations.HasteRatingEffects);

                    #region Legend
                    legendY = 2;

                    Color[] colors = new Color[] {
                        Color.FromArgb(255,202,180,96), 
                        Color.FromArgb(255,101,225,240),
                        Color.FromArgb(255,0,4,3), 
                        Color.FromArgb(255,238,238,30),
                        Color.FromArgb(255,45,112,63), 
                        Color.FromArgb(255,121,72,210), 
                        Color.FromArgb(255,217,100,54), 
                        Color.FromArgb(255,210,72,195), 
                        Color.FromArgb(255,206,189,191), 
                        Color.FromArgb(255,255,0,0), 
                        Color.FromArgb(255,0,255,0), 
                        Color.FromArgb(255,0,0,255), 
                    };

                    brushSubPoints = new Brush[effectList.Count];
                    colorSubPointsA = new Color[effectList.Count];
                    colorSubPointsB = new Color[effectList.Count];
                    for (int i = 0; i < effectList.Count; i++)
                    {
                        Color baseColor = colors[i];
                        brushSubPoints[i] = new SolidBrush(Color.FromArgb(baseColor.R / 2, baseColor.G / 2, baseColor.B / 2));
                        colorSubPointsA[i] = Color.FromArgb(baseColor.A / 2, baseColor.R / 2, baseColor.G / 2, baseColor.B / 2);
                        colorSubPointsB[i] = Color.FromArgb(baseColor.A / 2, baseColor);
                    }

                    for (int i = 0; i < effectList.Count; i++)
                    {
                        g.DrawLine(new Pen(colors[i]), new Point(20, legendY + 7), new Point(50, legendY + 7));
                        //g.DrawString(effectList[i].ToString(), fontLegend, Brushes.Black, new Point(60, legendY));

                        legendY += 16;
                    }

                    #endregion

                    #region Graph Ticks
                    graphStart = 30f;
                    graphWidth = width - 50f;
                    graphTop = legendY;
                    graphBottom = height - 4 - 4 * effectList.Count;
                    graphHeight = graphBottom - graphTop - 40;
                    maxScale = calculationOptions.FightDuration;
                    graphEnd = graphStart + graphWidth;
                    ticks = new float[] {(float)Math.Round(graphStart + graphWidth * 0.5f),
                            (float)Math.Round(graphStart + graphWidth * 0.75f),
                            (float)Math.Round(graphStart + graphWidth * 0.25f),
                            (float)Math.Round(graphStart + graphWidth * 0.125f),
                            (float)Math.Round(graphStart + graphWidth * 0.375f),
                            (float)Math.Round(graphStart + graphWidth * 0.625f),
                            (float)Math.Round(graphStart + graphWidth * 0.875f)};

                    for (int i = 0; i <= 10; i++)
                    {
                        float h = (float)Math.Round(graphBottom - graphHeight * i / 10.0);
                        g.DrawLine(black25, graphStart - 4, h, graphEnd, h);
                        //g.DrawLine(black200, graphStart - 4, h, graphStart, h);

                        g.DrawString((i / 10.0).ToString("F1"), fontLegend, black200brush, graphStart - 15, h + 6, formatTick);
                    }

                    g.DrawLine(black150, ticks[1], graphTop + 36, ticks[1], graphTop + 39);
                    g.DrawLine(black150, ticks[2], graphTop + 36, ticks[2], graphTop + 39);
                    g.DrawLine(black75, ticks[3], graphTop + 36, ticks[3], graphTop + 39);
                    g.DrawLine(black75, ticks[4], graphTop + 36, ticks[4], graphTop + 39);
                    g.DrawLine(black75, ticks[5], graphTop + 36, ticks[5], graphTop + 39);
                    g.DrawLine(black75, ticks[6], graphTop + 36, ticks[6], graphTop + 39);
                    g.DrawLine(black75, graphEnd, graphTop + 41, graphEnd, height - 4);
                    g.DrawLine(black75, ticks[0], graphTop + 41, ticks[0], height - 4);
                    g.DrawLine(black50, ticks[1], graphTop + 41, ticks[1], height - 4);
                    g.DrawLine(black50, ticks[2], graphTop + 41, ticks[2], height - 4);
                    g.DrawLine(black25, ticks[3], graphTop + 41, ticks[3], height - 4);
                    g.DrawLine(black25, ticks[4], graphTop + 41, ticks[4], height - 4);
                    g.DrawLine(black25, ticks[5], graphTop + 41, ticks[5], height - 4);
                    g.DrawLine(black25, ticks[6], graphTop + 41, ticks[6], height - 4);
                    g.DrawLine(black200, graphStart - 4, graphTop + 40, graphEnd + 4, graphTop + 40);
                    g.DrawLine(black200, graphStart, graphTop + 36, graphStart, height - 4);
                    g.DrawLine(black200, graphEnd, graphTop + 36, graphEnd, height - 4);
                    g.DrawLine(black200, graphStart - 4, graphBottom, graphEnd + 4, graphBottom);

                    g.DrawString(TimeFormat(0f), fontLegend, black200brush, graphStart, graphTop + 36, formatTick);
                    g.DrawString(TimeFormat(maxScale), fontLegend, black200brush, graphEnd, graphTop + 36, formatTick);
                    g.DrawString(TimeFormat(maxScale * 0.5f), fontLegend, black200brush, ticks[0], graphTop + 36, formatTick);
                    g.DrawString(TimeFormat(maxScale * 0.75f), fontLegend, black150brush, ticks[1], graphTop + 36, formatTick);
                    g.DrawString(TimeFormat(maxScale * 0.25f), fontLegend, black150brush, ticks[2], graphTop + 36, formatTick);
                    g.DrawString(TimeFormat(maxScale * 0.125f), fontLegend, black75brush, ticks[3], graphTop + 36, formatTick);
                    g.DrawString(TimeFormat(maxScale * 0.375f), fontLegend, black75brush, ticks[4], graphTop + 36, formatTick);
                    g.DrawString(TimeFormat(maxScale * 0.625f), fontLegend, black75brush, ticks[5], graphTop + 36, formatTick);
                    g.DrawString(TimeFormat(maxScale * 0.875f), fontLegend, black75brush, ticks[6], graphTop + 36, formatTick);
                    #endregion

                    for (int i = 0; i < effectList.Count; i++)
                    {
                        float procs = 0.0f;
                        float triggers = 0.0f;
                        for (int j = 0; j < calculations.SolutionVariable.Count; j++)
                        {
                            if (calculations.Solution[j] > 0)
                            {
                                Cycle c = calculations.SolutionVariable[j].Cycle;
                                if (c != null)
                                {
                                    switch (effectList[i].Trigger)
                                    {
                                        case Trigger.DamageSpellCrit:
                                        case Trigger.SpellCrit:
                                            triggers += (float)calculations.Solution[j] * c.Ticks / c.CastTime;
                                            procs += (float)calculations.Solution[j] * c.CritProcs / c.CastTime;
                                            break;
                                        case Trigger.DamageSpellHit:
                                        case Trigger.SpellHit:
                                            triggers += (float)calculations.Solution[j] * c.Ticks / c.CastTime;
                                            procs += (float)calculations.Solution[j] * c.HitProcs / c.CastTime;
                                            break;
                                        case Trigger.SpellMiss:
                                            triggers += (float)calculations.Solution[j] * c.Ticks / c.CastTime;
                                            procs += (float)calculations.Solution[j] * (1 - c.HitProcs) / c.CastTime;
                                            break;
                                        case Trigger.DamageSpellCast:
                                        case Trigger.SpellCast:
                                            if (effectList[i].Stats.ValkyrDamage > 0)
                                            {
                                                triggers += (float)calculations.Solution[j] * c.CastProcs2 / c.CastTime;
                                                procs += (float)calculations.Solution[j] * c.CastProcs2 / c.CastTime;
                                            }
                                            else
                                            {
                                                triggers += (float)calculations.Solution[j] * c.CastProcs / c.CastTime;
                                                procs += (float)calculations.Solution[j] * c.CastProcs / c.CastTime;
                                            }
                                            break;
                                        case Trigger.MageNukeCast:
                                            triggers += (float)calculations.Solution[j] * c.NukeProcs / c.CastTime;
                                            procs += (float)calculations.Solution[j] * c.NukeProcs / c.CastTime;
                                            break;
                                        case Trigger.DamageDone:
                                        case Trigger.DamageOrHealingDone:
                                            triggers += (float)calculations.Solution[j] * c.DamageProcs / c.CastTime;
                                            procs += (float)calculations.Solution[j] * c.DamageProcs / c.CastTime;
                                            break;
                                        case Trigger.DoTTick:
                                            triggers += (float)calculations.Solution[j] * c.DotProcs / c.CastTime;
                                            procs += (float)calculations.Solution[j] * c.DotProcs / c.CastTime;
                                            break;
                                    }
                                }
                            }
                        }
                        float triggerInterval = calculations.CalculationOptions.FightDuration / triggers;
                        float triggerChance = Math.Min(1.0f, procs / triggers);

                        int steps = 200;
                        PointF[] plot = new PointF[steps + 1];
                        for (int tick = 0; tick <= steps; tick++)
                        {
                            float time = tick / (float)steps * calculations.CalculationOptions.FightDuration;
                            plot[tick] = new PointF(graphStart + time / maxScale * graphWidth, graphBottom - graphHeight * effectList[i].GetUptimePlot(triggerInterval, triggerChance, 3.0f, time));
                        }

                        g.DrawLines(new Pen(colors[i]), plot);

                        g.DrawString(string.Format("{0} (average uptime {1:F}%)", effectList[i], effectList[i].GetAverageUptime(triggerInterval, triggerChance, 3.0f, calculations.CalculationOptions.FightDuration) * 100), fontLegend, Brushes.Black, new Point(60, 2 + i * 16));
                    }
                    break;
                case "Sequence Reconstruction":

                    if (calculationOptions.SequenceReconstruction == null)
                    {
                        g.DrawString("Sequence reconstruction data is not available.", fontLegend, Brushes.Black, 2, 2);
                    }
                    else
                    {
        #region Legend
                        legendY = 2;

                        List<EffectCooldown> cooldownList = calculationOptions.Calculations.CooldownList;

                        brushSubPoints = new Brush[cooldownList.Count];
                        colorSubPointsA = new Color[cooldownList.Count];
                        colorSubPointsB = new Color[cooldownList.Count];
                        for (int i = 0; i < cooldownList.Count; i++)
                        {
                            Color baseColor = cooldownList[i].Color;
                            brushSubPoints[i] = new SolidBrush(Color.FromArgb(baseColor.R / 2, baseColor.G / 2, baseColor.B / 2));
                            colorSubPointsA[i] = Color.FromArgb(baseColor.A / 2, baseColor.R / 2, baseColor.G / 2, baseColor.B / 2);
                            colorSubPointsB[i] = Color.FromArgb(baseColor.A / 2, baseColor);
                        }
                        StringFormat formatSubPoint = new StringFormat();
                        formatSubPoint.Alignment = StringAlignment.Center;
                        formatSubPoint.LineAlignment = StringAlignment.Center;

                        int maxWidth = 1;
                        for (int i = 0; i < cooldownList.Count; i++)
                        {
                            string subPointName = cooldownList[i].Name;
                            int widthSubPoint = (int)Math.Ceiling(g.MeasureString(subPointName, fontLegend).Width + 2f);
                            if (widthSubPoint > maxWidth) maxWidth = widthSubPoint;
                        }
                        for (int i = 0; i < cooldownList.Count; i++)
                        {
                            string cooldownName = cooldownList[i].Name;
                            rectSubPoint = new Rectangle(2, legendY, maxWidth, 16);
                            blendSubPoint = new System.Drawing.Drawing2D.ColorBlend(3);
                            blendSubPoint.Colors = new Color[] { colorSubPointsA[i], colorSubPointsB[i], colorSubPointsA[i] };
                            blendSubPoint.Positions = new float[] { 0f, 0.5f, 1f };
                            brushSubPointFill = new System.Drawing.Drawing2D.LinearGradientBrush(rectSubPoint, colorSubPointsA[i], colorSubPointsB[i], 67f);
                            brushSubPointFill.InterpolationColors = blendSubPoint;

                            g.FillRectangle(brushSubPointFill, rectSubPoint);
                            g.DrawRectangle(new Pen(brushSubPointFill), rectSubPoint);
                            g.DrawRectangle(new Pen(brushSubPointFill), rectSubPoint);
                            g.DrawRectangle(new Pen(brushSubPointFill), rectSubPoint);

                            g.DrawString(cooldownName, fontLegend, brushSubPoints[i], rectSubPoint, formatSubPoint);
                            legendY += 16;
                        }

                        if (calculationOptions.AdviseAdvancedSolver)
                        {
                            g.DrawString("Sequence Reconstruction was not fully successful, it is recommended that you enable more options in advanced solver (segment cooldowns, integral mana consumables, advanced constraints options)!", fontLegend, Brushes.Black, new RectangleF(5 + maxWidth, 40, width - maxWidth - 10, 100));
                        }

                        g.DrawLine(Pens.Aqua, new Point(maxWidth + 40, 10), new Point(maxWidth + 80, 10));
                        g.DrawString("Mana", fontLegend, Brushes.Black, new Point(maxWidth + 90, 2));
                        g.DrawLine(Pens.Red, new Point(maxWidth + 40, 26), new Point(maxWidth + 80, 26));
                        g.DrawString("Dps", fontLegend, Brushes.Black, new Point(maxWidth + 90, 18));
                        #endregion

        #region Graph Ticks
                        graphStart = 20f;
                        graphWidth = width - 40f;
                        graphTop = legendY;
                        graphBottom = height - 4 - 4 * cooldownList.Count;
                        graphHeight = graphBottom - graphTop - 40;
                        maxScale = calculationOptions.FightDuration;
                        graphEnd = graphStart + graphWidth;
                        ticks = new float[] {(float)Math.Round(graphStart + graphWidth * 0.5f),
                            (float)Math.Round(graphStart + graphWidth * 0.75f),
                            (float)Math.Round(graphStart + graphWidth * 0.25f),
                            (float)Math.Round(graphStart + graphWidth * 0.125f),
                            (float)Math.Round(graphStart + graphWidth * 0.375f),
                            (float)Math.Round(graphStart + graphWidth * 0.625f),
                            (float)Math.Round(graphStart + graphWidth * 0.875f)};

                        g.DrawLine(black150, ticks[1], graphTop + 36, ticks[1], graphTop + 39);
                        g.DrawLine(black150, ticks[2], graphTop + 36, ticks[2], graphTop + 39);
                        g.DrawLine(black75, ticks[3], graphTop + 36, ticks[3], graphTop + 39);
                        g.DrawLine(black75, ticks[4], graphTop + 36, ticks[4], graphTop + 39);
                        g.DrawLine(black75, ticks[5], graphTop + 36, ticks[5], graphTop + 39);
                        g.DrawLine(black75, ticks[6], graphTop + 36, ticks[6], graphTop + 39);
                        g.DrawLine(black75, graphEnd, graphTop + 41, graphEnd, height - 4);
                        g.DrawLine(black75, ticks[0], graphTop + 41, ticks[0], height - 4);
                        g.DrawLine(black50, ticks[1], graphTop + 41, ticks[1], height - 4);
                        g.DrawLine(black50, ticks[2], graphTop + 41, ticks[2], height - 4);
                        g.DrawLine(black25, ticks[3], graphTop + 41, ticks[3], height - 4);
                        g.DrawLine(black25, ticks[4], graphTop + 41, ticks[4], height - 4);
                        g.DrawLine(black25, ticks[5], graphTop + 41, ticks[5], height - 4);
                        g.DrawLine(black25, ticks[6], graphTop + 41, ticks[6], height - 4);
                        g.DrawLine(black200, graphStart - 4, graphTop + 40, graphEnd + 4, graphTop + 40);
                        g.DrawLine(black200, graphStart, graphTop + 36, graphStart, height - 4);
                        g.DrawLine(black200, graphEnd, graphTop + 36, graphEnd, height - 4);
                        g.DrawLine(black200, graphStart - 4, graphBottom, graphEnd + 4, graphBottom);

                        g.DrawString(TimeFormat(0f), fontLegend, black200brush, graphStart, graphTop + 36, formatTick);
                        g.DrawString(TimeFormat(maxScale), fontLegend, black200brush, graphEnd, graphTop + 36, formatTick);
                        g.DrawString(TimeFormat(maxScale * 0.5f), fontLegend, black200brush, ticks[0], graphTop + 36, formatTick);
                        g.DrawString(TimeFormat(maxScale * 0.75f), fontLegend, black150brush, ticks[1], graphTop + 36, formatTick);
                        g.DrawString(TimeFormat(maxScale * 0.25f), fontLegend, black150brush, ticks[2], graphTop + 36, formatTick);
                        g.DrawString(TimeFormat(maxScale * 0.125f), fontLegend, black75brush, ticks[3], graphTop + 36, formatTick);
                        g.DrawString(TimeFormat(maxScale * 0.375f), fontLegend, black75brush, ticks[4], graphTop + 36, formatTick);
                        g.DrawString(TimeFormat(maxScale * 0.625f), fontLegend, black75brush, ticks[5], graphTop + 36, formatTick);
                        g.DrawString(TimeFormat(maxScale * 0.875f), fontLegend, black75brush, ticks[6], graphTop + 36, formatTick);
                        #endregion

                        List<SequenceReconstruction.SequenceItem> sequence = calculationOptions.SequenceReconstruction.sequence;

                        float mana = calculations.StartingMana;
                        int gemCount = 0;
                        float time = 0;
                        Color manaFill = Color.FromArgb(50, Color.FromArgb(255, 0, 0, 255));
                        float lastMana = mana;
                        float maxMana = calculations.BaseStats.Mana;
                        float maxDps = 100;
                        for (int i = 0; i < sequence.Count; i++)
                        {
                            int index = sequence[i].Index;
                            VariableType type = sequence[i].VariableType;
                            float duration = (float)sequence[i].Duration;
                            Cycle cycle = sequence[i].Cycle;
                            if (cycle != null && cycle.DamagePerSecond > maxDps) maxDps = cycle.DamagePerSecond;
                            CastingState state = sequence[i].CastingState;
                            float mps = (float)sequence[i].Mps;
                            if (sequence[i].IsManaPotionOrGem)
                            {
                                duration = 0;
                                if (sequence[i].VariableType == VariableType.ManaGem)
                                {
                                    mana += (float)((1 + calculations.BaseStats.BonusManaGem) * calculations.ManaGemValue);
                                    gemCount++;
                                }
                                else if (sequence[i].VariableType == VariableType.ManaPotion)
                                {
                                    mana += (float)((1 + calculations.BaseStats.BonusManaPotion) * calculations.ManaPotionValue);
                                }
                                if (mana < 0) mana = 0;
                                if (mana > maxMana)
                                {
                                    mana = maxMana;
                                }
                                g.DrawLine(Pens.Aqua, graphStart + time / maxScale * graphWidth, graphBottom - graphHeight * lastMana / maxMana, graphStart + time / maxScale * graphWidth, height - 44 - graphHeight * mana / maxMana);
                            }
                            else
                            {
                                if (sequence[i].IsEvocation)
                                {
                                    switch (sequence[i].VariableType)
                                    {
                                        case VariableType.Evocation:
                                            mps = -(float)calculationOptions.Calculations.EvocationRegen;
                                            break;
                                        case VariableType.EvocationIV:
                                            mps = -(float)calculationOptions.Calculations.EvocationRegenIV;
                                            break;
                                        case VariableType.EvocationHero:
                                            mps = -(float)calculationOptions.Calculations.EvocationRegenHero;
                                            break;
                                        case VariableType.EvocationIVHero:
                                            mps = -(float)calculationOptions.Calculations.EvocationRegenIVHero;
                                            break;
                                    }
                                }
                                float partTime = duration;
                                if (mana - mps * duration < 0) partTime = mana / mps;
                                else if (mana - mps * duration > maxMana) partTime = (mana - maxMana) / mps;
                                mana -= mps * duration;
                                if (mana < 0) mana = 0;
                                if (mana > maxMana)
                                {
                                    mana = maxMana;
                                }
                                float x1 = graphStart + time / maxScale * graphWidth;
                                float x2 = graphStart + (time + partTime) / maxScale * graphWidth;
                                float x3 = graphStart + (time + duration) / maxScale * graphWidth;
                                float y1 = graphBottom - graphHeight * lastMana / maxMana;
                                float y2 = graphBottom - graphHeight * mana / maxMana;
                                float y3 = graphBottom;
                                g.FillPolygon(new SolidBrush(manaFill), new PointF[] { new PointF(x1, y1), new PointF(x2, y2), new PointF(x3, y2), new PointF(x3, y3), new PointF(x1, y3) });
                                g.DrawLine(Pens.Aqua, x1, y1, x2, y2);
                                g.DrawLine(Pens.Aqua, x2, y2, x3, y2);
                            }
                            lastMana = mana;
                            time += duration;
                        }

                        maxDps *= 1.1f;
                        List<PointF> list = new List<PointF>();
                        time = 0.0f;
                        for (int i = 0; i < sequence.Count; i++)
                        {
                            int index = sequence[i].Index;
                            VariableType type = sequence[i].VariableType;
                            float duration = (float)sequence[i].Duration;
                            Cycle cycle = sequence[i].Cycle;
                            CastingState state = sequence[i].CastingState;
                            float mps = (float)sequence[i].Mps;
                            if (sequence[i].IsManaPotionOrGem) duration = 0;
                            float dps = 0;
                            if (cycle != null)
                            {
                                dps = cycle.DamagePerSecond;
                            }
                            if (duration > 0)
                            {
                                list.Add(new PointF(graphStart + (time + 0.1f * duration) / maxScale * graphWidth, graphBottom - graphHeight * dps / maxDps));
                                list.Add(new PointF(graphStart + (time + 0.9f * duration) / maxScale * graphWidth, graphBottom - graphHeight * dps / maxDps));
                            }
                            time += duration;
                        }
                        if (list.Count > 0) g.DrawLines(Pens.Red, list.ToArray());

                        for (int cooldown = 0; cooldown < cooldownList.Count; cooldown++)
                        {
                            blendSubPoint = new System.Drawing.Drawing2D.ColorBlend(3);
                            blendSubPoint.Colors = new Color[] { colorSubPointsA[cooldown], colorSubPointsB[cooldown], colorSubPointsA[cooldown] };
                            blendSubPoint.Positions = new float[] { 0f, 0.5f, 1f };
                            bool on = false;
                            float timeOn = 0.0f;
                            time = 0;
                            for (int i = 0; i < sequence.Count; i++)
                            {
                                float duration = (float)sequence[i].Duration;
                                if (sequence[i].IsManaPotionOrGem) duration = 0;
                                if (on && !sequence[i].CastingState.EffectsActive(cooldownList[cooldown]) && !sequence[i].IsManaPotionOrGem)
                                {
                                    on = false;
                                    if (time > timeOn)
                                    {
                                        RectangleF rect = new RectangleF(graphStart + graphWidth * timeOn / maxScale, graphBottom + cooldown * 4, graphWidth * (time - timeOn) / maxScale, 4);
                                        brushSubPointFill = new System.Drawing.Drawing2D.LinearGradientBrush(rect, colorSubPointsA[cooldown], colorSubPointsB[cooldown], 67f);
                                        brushSubPointFill.InterpolationColors = blendSubPoint;

                                        g.FillRectangle(brushSubPointFill, rect);
                                        g.DrawRectangle(new Pen(brushSubPointFill), rect.X, rect.Y, rect.Width, rect.Height);
                                        g.DrawRectangle(new Pen(brushSubPointFill), rect.X, rect.Y, rect.Width, rect.Height);
                                        g.DrawRectangle(new Pen(brushSubPointFill), rect.X, rect.Y, rect.Width, rect.Height);
                                    }
                                }
                                else if (!on && sequence[i].CastingState.EffectsActive(cooldownList[cooldown]))
                                {
                                    on = true;
                                    timeOn = time;
                                }
                                time += duration;
                            }
                            if (on)
                            {
                                if (time - timeOn > 0)
                                {
                                    RectangleF rect = new RectangleF(graphStart + graphWidth * timeOn / maxScale, graphBottom + cooldown * 4, graphWidth * (time - timeOn) / maxScale, 4);
                                    brushSubPointFill = new System.Drawing.Drawing2D.LinearGradientBrush(rect, colorSubPointsA[cooldown], colorSubPointsB[cooldown], 67f);
                                    brushSubPointFill.InterpolationColors = blendSubPoint;

                                    g.FillRectangle(brushSubPointFill, rect);
                                    g.DrawRectangle(new Pen(brushSubPointFill), rect.X, rect.Y, rect.Width, rect.Height);
                                    g.DrawRectangle(new Pen(brushSubPointFill), rect.X, rect.Y, rect.Width, rect.Height);
                                    g.DrawRectangle(new Pen(brushSubPointFill), rect.X, rect.Y, rect.Width, rect.Height);
                                }
                            }
                        }
                    }
                    break;
                case "Scaling vs Spell Power":
                    Base.Graph.RenderScalingGraph(g, width, height, character, statsList, new Stats() { SpellPower = 5 }, true, statColors, 100, "", "Dps Rating", Base.Graph.Style.Mage);
                    break;
                case "Scaling vs Crit Rating":
                    Base.Graph.RenderScalingGraph(g, width, height, character, statsList, new Stats() { CritRating = 5 }, true, statColors, 100, "", "Dps Rating", Base.Graph.Style.Mage);
                    break;
                case "Scaling vs Haste Rating":
                    Base.Graph.RenderScalingGraph(g, width, height, character, statsList, new Stats() { HasteRating = 5 }, true, statColors, 100, "", "Dps Rating", Base.Graph.Style.Mage);
                    break;
                case "Scaling vs Intellect":
                    Base.Graph.RenderScalingGraph(g, width, height, character, statsList, new Stats() { Intellect = 5 }, true, statColors, 100, "", "Dps Rating", Base.Graph.Style.Mage);
                    break;
                case "Scaling vs Spirit":
                    Base.Graph.RenderScalingGraph(g, width, height, character, statsList, new Stats() { Spirit = 5 }, true, statColors, 100, "", "Dps Rating", Base.Graph.Style.Mage);
                    break;
            }
        }
コード例 #35
0
ファイル: BitmapButton.cs プロジェクト: mahitosh/HRA4
        /// <summary>
        /// paint the inner border of the button.
        /// </summary>
        /// <param name="e">paint arguments use to paint the button</param>
        private void paint_InnerBorder(PaintEventArgs e)
        {
            if (e == null)
            {
                return;
            }
            if (e.Graphics == null)
            {
                return;
            }

            Graphics g = e.Graphics;

            System.Drawing.Rectangle rect = new Rectangle(0, 0, Size.Width, Size.Height);

            System.Drawing.Color color = this.BackColor;
            //
            // get color of inner border
            //
            switch (btnState)
            {
            case BtnState.Inactive:
                color = System.Drawing.Color.Gray;
                break;

            case BtnState.Normal:
                if (this.Focused)
                {
                    color = this.InnerBorderColor_Focus;
                }
                else
                {
                    color = this.InnerBorderColor;
                }
                break;

            case BtnState.Pushed:
                color = Blend(InnerBorderColor_Focus, System.Drawing.Color.Black, 10);
                break;

            case BtnState.MouseOver:
                color = InnerBorderColor_MouseOver;
                break;
            }
            //
            // populate color and position arrays
            //
            Color[] ColorArray    = null;
            float[] PositionArray = null;
            if (btnState == BtnState.Pushed)
            {
                ColorArray = new System.Drawing.Color [] {
                    Blend(color, System.Drawing.Color.Black, 20),
                    Blend(color, System.Drawing.Color.Black, 10),
                    Blend(color, System.Drawing.Color.White, 00),
                    Blend(color, System.Drawing.Color.White, 50),
                    Blend(color, System.Drawing.Color.White, 85),
                    Blend(color, System.Drawing.Color.White, 90),
                };
                PositionArray = new float[] { 0.0f, .20f, .50f, .60f, .90f, 1.0f };
            }
            else
            {
                ColorArray = new System.Drawing.Color [] {
                    Blend(color, System.Drawing.Color.White, 80),
                    Blend(color, System.Drawing.Color.White, 60),
                    Blend(color, System.Drawing.Color.White, 10),
                    Blend(color, System.Drawing.Color.White, 00),
                    Blend(color, System.Drawing.Color.Black, 20),
                    Blend(color, System.Drawing.Color.Black, 50),
                };
                PositionArray = new float[] { 0.0f, .20f, .50f, .60f, .90f, 1.0f };
            }
            //
            // create blend object
            //
            System.Drawing.Drawing2D.ColorBlend blend = new System.Drawing.Drawing2D.ColorBlend();
            blend.Colors    = ColorArray;
            blend.Positions = PositionArray;
            //
            // create gradient brush and pen
            //
            System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(rect, this.BackColor, Blend(this.BackColor, this.BackColor, 10), System.Drawing.Drawing2D.LinearGradientMode.Vertical);
            brush.InterpolationColors = blend;
            System.Drawing.Pen pen0 = new System.Drawing.Pen(brush, 1);
            //
            // get points array to draw the line
            //
            Point[] pts = border_Get(0, 0, this.Width - 1, this.Height - 1);
            //
            // draw line 0
            //
            this.border_Contract(1, ref pts);
            e.Graphics.DrawLines(pen0, pts);
            //
            // draw line 1
            //
            this.border_Contract(1, ref pts);
            e.Graphics.DrawLines(pen0, pts);
            //
            // release resources
            //
            pen0.Dispose();
            brush.Dispose();
        }
コード例 #36
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     OgamaControls.Gradient gradient1 = new OgamaControls.Gradient();
     System.Drawing.Drawing2D.ColorBlend            colorBlend1 = new System.Drawing.Drawing2D.ColorBlend();
     System.ComponentModel.ComponentResourceManager resources   = new System.ComponentModel.ComponentResourceManager(typeof(ColorDefinitionDialog));
     this.splitContainer2     = new System.Windows.Forms.SplitContainer();
     this.trvSubjects         = new System.Windows.Forms.TreeView();
     this.splitContainer1     = new System.Windows.Forms.SplitContainer();
     this.btnNumbersStyle     = new System.Windows.Forms.Button();
     this.btnConnectionsStyle = new System.Windows.Forms.Button();
     this.btnFixationsStyle   = new System.Windows.Forms.Button();
     this.panel1                = new System.Windows.Forms.Panel();
     this.pnlPreview            = new System.Windows.Forms.Panel();
     this.splitContainer3       = new System.Windows.Forms.SplitContainer();
     this.rdbColorSubjects      = new System.Windows.Forms.RadioButton();
     this.cbbPredefinedGradient = new System.Windows.Forms.ComboBox();
     this.rdbColorGroups        = new System.Windows.Forms.RadioButton();
     this.label3                = new System.Windows.Forms.Label();
     this.rdbColorAutomatic     = new System.Windows.Forms.RadioButton();
     this.label2                = new System.Windows.Forms.Label();
     this.label1                = new System.Windows.Forms.Label();
     this.spcGradientSingle     = new System.Windows.Forms.SplitContainer();
     this.gradientControl       = new OgamaControls.GradientTypeEditorUI();
     this.grpPreview            = new System.Windows.Forms.GroupBox();
     this.spcPreview            = new System.Windows.Forms.SplitContainer();
     this.btnOK      = new System.Windows.Forms.Button();
     this.btnCancel  = new System.Windows.Forms.Button();
     this.dialogTop1 = new DialogTop();
     this.splitContainer2.Panel1.SuspendLayout();
     this.splitContainer2.Panel2.SuspendLayout();
     this.splitContainer2.SuspendLayout();
     this.splitContainer1.Panel1.SuspendLayout();
     this.splitContainer1.Panel2.SuspendLayout();
     this.splitContainer1.SuspendLayout();
     this.panel1.SuspendLayout();
     this.splitContainer3.Panel1.SuspendLayout();
     this.splitContainer3.Panel2.SuspendLayout();
     this.splitContainer3.SuspendLayout();
     this.spcGradientSingle.Panel1.SuspendLayout();
     this.spcGradientSingle.Panel2.SuspendLayout();
     this.spcGradientSingle.SuspendLayout();
     this.grpPreview.SuspendLayout();
     this.spcPreview.Panel1.SuspendLayout();
     this.spcPreview.Panel2.SuspendLayout();
     this.spcPreview.SuspendLayout();
     this.SuspendLayout();
     //
     // splitContainer2
     //
     this.splitContainer2.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.splitContainer2.Location = new System.Drawing.Point(0, 60);
     this.splitContainer2.Name     = "splitContainer2";
     //
     // splitContainer2.Panel1
     //
     this.splitContainer2.Panel1.Controls.Add(this.trvSubjects);
     //
     // splitContainer2.Panel2
     //
     this.splitContainer2.Panel2.Controls.Add(this.splitContainer1);
     this.splitContainer2.Size             = new System.Drawing.Size(719, 431);
     this.splitContainer2.SplitterDistance = 213;
     this.splitContainer2.TabIndex         = 1;
     //
     // trvSubjects
     //
     this.trvSubjects.Dock         = System.Windows.Forms.DockStyle.Fill;
     this.trvSubjects.DrawMode     = System.Windows.Forms.TreeViewDrawMode.OwnerDrawText;
     this.trvSubjects.Location     = new System.Drawing.Point(0, 0);
     this.trvSubjects.Name         = "trvSubjects";
     this.trvSubjects.Size         = new System.Drawing.Size(213, 431);
     this.trvSubjects.TabIndex     = 1;
     this.trvSubjects.DrawNode    += new System.Windows.Forms.DrawTreeNodeEventHandler(this.trvSubjects_DrawNode);
     this.trvSubjects.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.trvSubjects_AfterSelect);
     //
     // splitContainer1
     //
     this.splitContainer1.Dock            = System.Windows.Forms.DockStyle.Fill;
     this.splitContainer1.FixedPanel      = System.Windows.Forms.FixedPanel.Panel2;
     this.splitContainer1.IsSplitterFixed = true;
     this.splitContainer1.Location        = new System.Drawing.Point(0, 0);
     this.splitContainer1.Name            = "splitContainer1";
     this.splitContainer1.Orientation     = System.Windows.Forms.Orientation.Horizontal;
     //
     // splitContainer1.Panel1
     //
     this.splitContainer1.Panel1.Controls.Add(this.splitContainer3);
     //
     // splitContainer1.Panel2
     //
     this.splitContainer1.Panel2.Controls.Add(this.btnOK);
     this.splitContainer1.Panel2.Controls.Add(this.btnCancel);
     this.splitContainer1.Panel2MinSize    = 35;
     this.splitContainer1.Size             = new System.Drawing.Size(502, 431);
     this.splitContainer1.SplitterDistance = 392;
     this.splitContainer1.TabIndex         = 16;
     //
     // btnNumbersStyle
     //
     this.btnNumbersStyle.Image                   = global::Ogama.Properties.Resources.Color_fontHS;
     this.btnNumbersStyle.Location                = new System.Drawing.Point(7, 65);
     this.btnNumbersStyle.Name                    = "btnNumbersStyle";
     this.btnNumbersStyle.Size                    = new System.Drawing.Size(122, 23);
     this.btnNumbersStyle.TabIndex                = 0;
     this.btnNumbersStyle.Text                    = "Numbers style";
     this.btnNumbersStyle.TextAlign               = System.Drawing.ContentAlignment.MiddleLeft;
     this.btnNumbersStyle.TextImageRelation       = System.Windows.Forms.TextImageRelation.ImageBeforeText;
     this.btnNumbersStyle.UseVisualStyleBackColor = true;
     this.btnNumbersStyle.Click                  += new System.EventHandler(this.btnNumbersStyle_Click);
     //
     // btnConnectionsStyle
     //
     this.btnConnectionsStyle.Image                   = global::Ogama.Properties.Resources.RPLFixConPen;
     this.btnConnectionsStyle.Location                = new System.Drawing.Point(7, 36);
     this.btnConnectionsStyle.Name                    = "btnConnectionsStyle";
     this.btnConnectionsStyle.Size                    = new System.Drawing.Size(122, 23);
     this.btnConnectionsStyle.TabIndex                = 0;
     this.btnConnectionsStyle.Text                    = "Connections style";
     this.btnConnectionsStyle.TextAlign               = System.Drawing.ContentAlignment.MiddleLeft;
     this.btnConnectionsStyle.TextImageRelation       = System.Windows.Forms.TextImageRelation.ImageBeforeText;
     this.btnConnectionsStyle.UseVisualStyleBackColor = true;
     this.btnConnectionsStyle.Click                  += new System.EventHandler(this.btnConnectionsStyle_Click);
     //
     // btnFixationsStyle
     //
     this.btnFixationsStyle.Image                   = global::Ogama.Properties.Resources.RPLFixPen;
     this.btnFixationsStyle.Location                = new System.Drawing.Point(7, 7);
     this.btnFixationsStyle.Name                    = "btnFixationsStyle";
     this.btnFixationsStyle.Size                    = new System.Drawing.Size(122, 23);
     this.btnFixationsStyle.TabIndex                = 0;
     this.btnFixationsStyle.Text                    = "Fixations style";
     this.btnFixationsStyle.TextAlign               = System.Drawing.ContentAlignment.MiddleLeft;
     this.btnFixationsStyle.TextImageRelation       = System.Windows.Forms.TextImageRelation.ImageBeforeText;
     this.btnFixationsStyle.UseVisualStyleBackColor = true;
     this.btnFixationsStyle.Click                  += new System.EventHandler(this.btnFixationsStyle_Click);
     //
     // panel1
     //
     this.panel1.Controls.Add(this.pnlPreview);
     this.panel1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.panel1.Location = new System.Drawing.Point(0, 0);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(362, 94);
     this.panel1.TabIndex = 0;
     //
     // pnlPreview
     //
     this.pnlPreview.BackColor = System.Drawing.Color.White;
     this.pnlPreview.Dock      = System.Windows.Forms.DockStyle.Top;
     this.pnlPreview.Location  = new System.Drawing.Point(0, 0);
     this.pnlPreview.Name      = "pnlPreview";
     this.pnlPreview.Size      = new System.Drawing.Size(362, 90);
     this.pnlPreview.TabIndex  = 0;
     this.pnlPreview.Paint    += new System.Windows.Forms.PaintEventHandler(this.pnlPreview_Paint);
     //
     // splitContainer3
     //
     this.splitContainer3.Dock            = System.Windows.Forms.DockStyle.Fill;
     this.splitContainer3.FixedPanel      = System.Windows.Forms.FixedPanel.Panel1;
     this.splitContainer3.IsSplitterFixed = true;
     this.splitContainer3.Location        = new System.Drawing.Point(0, 0);
     this.splitContainer3.Name            = "splitContainer3";
     this.splitContainer3.Orientation     = System.Windows.Forms.Orientation.Horizontal;
     //
     // splitContainer3.Panel1
     //
     this.splitContainer3.Panel1.Controls.Add(this.rdbColorSubjects);
     this.splitContainer3.Panel1.Controls.Add(this.cbbPredefinedGradient);
     this.splitContainer3.Panel1.Controls.Add(this.rdbColorGroups);
     this.splitContainer3.Panel1.Controls.Add(this.label3);
     this.splitContainer3.Panel1.Controls.Add(this.rdbColorAutomatic);
     this.splitContainer3.Panel1.Controls.Add(this.label2);
     this.splitContainer3.Panel1.Controls.Add(this.label1);
     //
     // splitContainer3.Panel2
     //
     this.splitContainer3.Panel2.Controls.Add(this.spcGradientSingle);
     this.splitContainer3.Size             = new System.Drawing.Size(502, 392);
     this.splitContainer3.SplitterDistance = 150;
     this.splitContainer3.TabIndex         = 0;
     //
     // rdbColorSubjects
     //
     this.rdbColorSubjects.AutoSize = true;
     this.rdbColorSubjects.Location = new System.Drawing.Point(6, 3);
     this.rdbColorSubjects.Name     = "rdbColorSubjects";
     this.rdbColorSubjects.Size     = new System.Drawing.Size(219, 17);
     this.rdbColorSubjects.TabIndex = 0;
     this.rdbColorSubjects.Text     = "Specify color for each subject separately.";
     this.rdbColorSubjects.UseVisualStyleBackColor = true;
     this.rdbColorSubjects.CheckedChanged         += new System.EventHandler(this.rdbColorization_CheckedChanged);
     //
     // cbbPredefinedGradient
     //
     this.cbbPredefinedGradient.FormattingEnabled = true;
     this.cbbPredefinedGradient.Items.AddRange(new object[] {
         "Custom",
         "Traffic Light",
         "Rainbow"
     });
     this.cbbPredefinedGradient.Location = new System.Drawing.Point(272, 86);
     this.cbbPredefinedGradient.Name     = "cbbPredefinedGradient";
     this.cbbPredefinedGradient.Size     = new System.Drawing.Size(87, 21);
     this.cbbPredefinedGradient.TabIndex = 4;
     this.cbbPredefinedGradient.Text     = "Custom";
     this.cbbPredefinedGradient.SelectionChangeCommitted += new System.EventHandler(this.cbbPredefinedGradient_SelectionChangeCommitted);
     //
     // rdbColorGroups
     //
     this.rdbColorGroups.AutoSize = true;
     this.rdbColorGroups.Location = new System.Drawing.Point(6, 46);
     this.rdbColorGroups.Name     = "rdbColorGroups";
     this.rdbColorGroups.Size     = new System.Drawing.Size(258, 17);
     this.rdbColorGroups.TabIndex = 0;
     this.rdbColorGroups.Text     = "Specify a color for each subject group separately.";
     this.rdbColorGroups.UseVisualStyleBackColor = true;
     this.rdbColorGroups.CheckedChanged         += new System.EventHandler(this.rdbColorization_CheckedChanged);
     //
     // label3
     //
     this.label3.AutoSize = true;
     this.label3.Location = new System.Drawing.Point(36, 107);
     this.label3.Name     = "label3";
     this.label3.Size     = new System.Drawing.Size(357, 13);
     this.label3.TabIndex = 2;
     this.label3.Text     = "Please define the gradient below or select one of the predefined gradients.";
     //
     // rdbColorAutomatic
     //
     this.rdbColorAutomatic.AutoSize = true;
     this.rdbColorAutomatic.Checked  = true;
     this.rdbColorAutomatic.Location = new System.Drawing.Point(6, 87);
     this.rdbColorAutomatic.Name     = "rdbColorAutomatic";
     this.rdbColorAutomatic.Size     = new System.Drawing.Size(243, 17);
     this.rdbColorAutomatic.TabIndex = 0;
     this.rdbColorAutomatic.TabStop  = true;
     this.rdbColorAutomatic.Text     = "Automatically colorize subjects with a gradient.";
     this.rdbColorAutomatic.UseVisualStyleBackColor = true;
     this.rdbColorAutomatic.CheckedChanged         += new System.EventHandler(this.rdbColorization_CheckedChanged);
     //
     // label2
     //
     this.label2.AutoSize = true;
     this.label2.Location = new System.Drawing.Point(36, 66);
     this.label2.Name     = "label2";
     this.label2.Size     = new System.Drawing.Size(425, 13);
     this.label2.TabIndex = 2;
     this.label2.Text     = "Please select a group and modify the color of its members by clicking on the colo" +
                            "r button.";
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(36, 23);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(348, 13);
     this.label1.TabIndex = 2;
     this.label1.Text     = "Please select subject and modify its color by clicking on the color button.";
     //
     // spcGradientSingle
     //
     this.spcGradientSingle.Dock        = System.Windows.Forms.DockStyle.Fill;
     this.spcGradientSingle.Location    = new System.Drawing.Point(0, 0);
     this.spcGradientSingle.Name        = "spcGradientSingle";
     this.spcGradientSingle.Orientation = System.Windows.Forms.Orientation.Horizontal;
     //
     // spcGradientSingle.Panel1
     //
     this.spcGradientSingle.Panel1.Controls.Add(this.gradientControl);
     //
     // spcGradientSingle.Panel2
     //
     this.spcGradientSingle.Panel2.Controls.Add(this.grpPreview);
     this.spcGradientSingle.Size             = new System.Drawing.Size(502, 238);
     this.spcGradientSingle.SplitterDistance = 121;
     this.spcGradientSingle.TabIndex         = 0;
     //
     // gradientControl
     //
     colorBlend1.Colors = new System.Drawing.Color[] {
         System.Drawing.Color.Transparent,
         System.Drawing.Color.Transparent
     };
     colorBlend1.Positions = new float[] {
         0F,
         1F
     };
     gradient1.ColorBlend                  = colorBlend1;
     gradient1.GradientDirection           = System.Drawing.Drawing2D.LinearGradientMode.Horizontal;
     this.gradientControl.Gradient         = gradient1;
     this.gradientControl.Location         = new System.Drawing.Point(0, 0);
     this.gradientControl.Name             = "gradientControl";
     this.gradientControl.Size             = new System.Drawing.Size(502, 102);
     this.gradientControl.TabIndex         = 0;
     this.gradientControl.GradientChanged += new System.EventHandler(this.gradientControl_GradientChanged);
     //
     // grpPreview
     //
     this.grpPreview.Controls.Add(this.spcPreview);
     this.grpPreview.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.grpPreview.Location = new System.Drawing.Point(0, 0);
     this.grpPreview.Name     = "grpPreview";
     this.grpPreview.Size     = new System.Drawing.Size(502, 113);
     this.grpPreview.TabIndex = 15;
     this.grpPreview.TabStop  = false;
     this.grpPreview.Text     = "Preview and modify custom style ...";
     //
     // spcPreview
     //
     this.spcPreview.Dock            = System.Windows.Forms.DockStyle.Fill;
     this.spcPreview.FixedPanel      = System.Windows.Forms.FixedPanel.Panel1;
     this.spcPreview.IsSplitterFixed = true;
     this.spcPreview.Location        = new System.Drawing.Point(3, 16);
     this.spcPreview.Name            = "spcPreview";
     //
     // spcPreview.Panel1
     //
     this.spcPreview.Panel1.Controls.Add(this.btnConnectionsStyle);
     this.spcPreview.Panel1.Controls.Add(this.btnFixationsStyle);
     this.spcPreview.Panel1.Controls.Add(this.btnNumbersStyle);
     //
     // spcPreview.Panel2
     //
     this.spcPreview.Panel2.Controls.Add(this.panel1);
     this.spcPreview.Size             = new System.Drawing.Size(496, 94);
     this.spcPreview.SplitterDistance = 130;
     this.spcPreview.TabIndex         = 1;
     //
     // btnOK
     //
     this.btnOK.Anchor                  = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnOK.DialogResult            = System.Windows.Forms.DialogResult.OK;
     this.btnOK.Location                = new System.Drawing.Point(343, 3);
     this.btnOK.Name                    = "btnOK";
     this.btnOK.Size                    = new System.Drawing.Size(75, 23);
     this.btnOK.TabIndex                = 3;
     this.btnOK.Text                    = "&OK";
     this.btnOK.UseVisualStyleBackColor = true;
     //
     // btnCancel
     //
     this.btnCancel.Anchor                  = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnCancel.DialogResult            = System.Windows.Forms.DialogResult.Cancel;
     this.btnCancel.Location                = new System.Drawing.Point(424, 4);
     this.btnCancel.Name                    = "btnCancel";
     this.btnCancel.Size                    = new System.Drawing.Size(75, 23);
     this.btnCancel.TabIndex                = 3;
     this.btnCancel.Text                    = "&Cancel";
     this.btnCancel.UseVisualStyleBackColor = true;
     //
     // dialogTop1
     //
     this.dialogTop1.BackColor             = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(237)))), ((int)(((byte)(237)))));
     this.dialogTop1.BackgroundImage       = ((System.Drawing.Image)(resources.GetObject("dialogTop1.BackgroundImage")));
     this.dialogTop1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
     this.dialogTop1.Description           = "Please specify how to colorize the subjects scanpaths.";
     this.dialogTop1.Dock     = System.Windows.Forms.DockStyle.Top;
     this.dialogTop1.Location = new System.Drawing.Point(0, 0);
     this.dialogTop1.Logo     = global::Ogama.Properties.Resources.DisplayInColorHS;
     this.dialogTop1.Name     = "dialogTop1";
     this.dialogTop1.Size     = new System.Drawing.Size(719, 60);
     this.dialogTop1.TabIndex = 2;
     //
     // ColorDefinitionDialog
     //
     this.AcceptButton        = this.btnOK;
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.CancelButton        = this.btnCancel;
     this.ClientSize          = new System.Drawing.Size(719, 491);
     this.Controls.Add(this.splitContainer2);
     this.Controls.Add(this.dialogTop1);
     this.Icon          = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Name          = "ColorDefinitionDialog";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
     this.Text          = "Define color range for the subjects.";
     this.splitContainer2.Panel1.ResumeLayout(false);
     this.splitContainer2.Panel2.ResumeLayout(false);
     this.splitContainer2.ResumeLayout(false);
     this.splitContainer1.Panel1.ResumeLayout(false);
     this.splitContainer1.Panel2.ResumeLayout(false);
     this.splitContainer1.ResumeLayout(false);
     this.panel1.ResumeLayout(false);
     this.splitContainer3.Panel1.ResumeLayout(false);
     this.splitContainer3.Panel1.PerformLayout();
     this.splitContainer3.Panel2.ResumeLayout(false);
     this.splitContainer3.ResumeLayout(false);
     this.spcGradientSingle.Panel1.ResumeLayout(false);
     this.spcGradientSingle.Panel2.ResumeLayout(false);
     this.spcGradientSingle.ResumeLayout(false);
     this.grpPreview.ResumeLayout(false);
     this.spcPreview.Panel1.ResumeLayout(false);
     this.spcPreview.Panel2.ResumeLayout(false);
     this.spcPreview.ResumeLayout(false);
     this.ResumeLayout(false);
 }
コード例 #37
0
        public void LinearGradient(double X1, double Y1, double X2, double Y2, double[] S, double[] A, double[] R, double[] G, double[] B)
        {
            Dash(0);

            if (brush[brush.Count - 1] != null)
                brush[brush.Count - 1].Dispose();

            System.Drawing.Drawing2D.LinearGradientBrush lgb = new System.Drawing.Drawing2D.LinearGradientBrush(
                new System.Drawing.PointF((float)X1, (float)Y1),
                new System.Drawing.PointF((float)X2, (float)Y2),
                System.Drawing.Color.Transparent,
                System.Drawing.Color.Transparent);

            System.Drawing.Drawing2D.ColorBlend cblend = new System.Drawing.Drawing2D.ColorBlend(S.Length);

            for (int i = 0; i < S.Length; i++)
            {
                cblend.Positions[i] = (float)S[i];
                cblend.Colors[i] = GetColor(A[i], R[i], G[i], B[i]);
            }

            lgb.InterpolationColors = cblend;

            brush[brush.Count - 1] = lgb;
        }
コード例 #38
0
ファイル: GradientEditor.cs プロジェクト: auxiliaire/cijada
        protected System.Drawing.Drawing2D.LinearGradientBrush getGradientBrush()
        {
            int p = 0;
            Point p1 = new Point(gradientX + 1, gradientY + 1);
            Point p2 = new Point(gradientX + 1 + gradientWidth, gradientY + 1 + gradientHeight);
            Color[] clrArray = new Color[map.Count];
            float[] posArray = new float[map.Count];
            foreach (GradientStop gs in map)
            {
                clrArray[p] = _c(gs.getColor());
                posArray[p] = (float)(0.01f * gs.getPosition());
                p++;
            } // end foreach
            System.Drawing.Drawing2D.LinearGradientBrush b = new System.Drawing.Drawing2D.LinearGradientBrush(p1, p2, Color.Blue, Color.Red);

            System.Drawing.Drawing2D.ColorBlend colorBlend = new System.Drawing.Drawing2D.ColorBlend();
            colorBlend.Colors = clrArray;
            colorBlend.Positions = posArray;
            // Set InterpolationColors property
            b.InterpolationColors = colorBlend;
            return b;
        }
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.Drawing.Drawing2D.ColorBlend            colorBlend1 = new System.Drawing.Drawing2D.ColorBlend();
            System.ComponentModel.ComponentResourceManager resources   = new System.ComponentModel.ComponentResourceManager(typeof(BrushPainter2EditorDialog));
            this.thematic1502          = new Zeroit.Framework.UniversalControl.ThemeManagers.SpicyLips();
            this.CloseBtn              = new System.Windows.Forms.Button();
            this.cancelButton          = new System.Windows.Forms.Button();
            this.okButton              = new System.Windows.Forms.Button();
            this.gradientGroupBox      = new System.Windows.Forms.GroupBox();
            this.gradientEditor        = new Zeroit.Framework.UniversalControl.Editors.ColorGradientEditor();
            this.hatchGroupBox         = new System.Windows.Forms.GroupBox();
            this.label4                = new System.Windows.Forms.Label();
            this.backAlphaNud          = new System.Windows.Forms.NumericUpDown();
            this.label1                = new System.Windows.Forms.Label();
            this.hatchAlphaNud         = new System.Windows.Forms.NumericUpDown();
            this.hatchComboBox         = new Zeroit.Framework.UniversalControl.Editors.HatchStyleComboBox();
            this.sampleHatchPanel      = new Zeroit.Framework.UniversalControl.Editors.HatchStylePanel();
            this.hatchPatternTextLabel = new System.Windows.Forms.Label();
            this.backColorButton       = new System.Windows.Forms.Button();
            this.backColorLabel        = new System.Windows.Forms.Label();
            this.backColorTextLabel    = new System.Windows.Forms.Label();
            this.hatchColorButton      = new System.Windows.Forms.Button();
            this.hatchColorLabel       = new System.Windows.Forms.Label();
            this.hatchColorTextLabel   = new System.Windows.Forms.Label();
            this.solidGroupBox         = new System.Windows.Forms.GroupBox();
            this.sampleSolidPanel      = new System.Windows.Forms.Label();
            this.opacityPreLabel       = new System.Windows.Forms.Label();
            this.solidAlphaNud         = new System.Windows.Forms.NumericUpDown();
            this.solidColorButton      = new System.Windows.Forms.Button();
            this.solidColorLabel       = new System.Windows.Forms.Label();
            this.solidColorTextLabel   = new System.Windows.Forms.Label();
            this.typeGroupBox          = new System.Windows.Forms.GroupBox();
            this.gradientRadioButton   = new System.Windows.Forms.RadioButton();
            this.hatchRadioButton      = new System.Windows.Forms.RadioButton();
            this.noneRadioButton       = new System.Windows.Forms.RadioButton();
            this.solidRadioButton      = new System.Windows.Forms.RadioButton();
            this.thematic1502.SuspendLayout();
            this.gradientGroupBox.SuspendLayout();
            this.hatchGroupBox.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.backAlphaNud)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.hatchAlphaNud)).BeginInit();
            this.solidGroupBox.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.solidAlphaNud)).BeginInit();
            this.typeGroupBox.SuspendLayout();
            this.SuspendLayout();
            //
            // thematic1502
            //

            this.thematic1502.BorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.thematic1502.Colors      = new Zeroit.Framework.UniversalControl.ThemeManagers.Bloom[0];
            this.thematic1502.Controls.Add(this.CloseBtn);
            this.thematic1502.Controls.Add(this.cancelButton);
            this.thematic1502.Controls.Add(this.okButton);
            this.thematic1502.Controls.Add(this.gradientGroupBox);
            this.thematic1502.Controls.Add(this.hatchGroupBox);
            this.thematic1502.Controls.Add(this.solidGroupBox);
            this.thematic1502.Controls.Add(this.typeGroupBox);
            this.thematic1502.Customization   = "";
            this.thematic1502.Dock            = System.Windows.Forms.DockStyle.Fill;
            this.thematic1502.Image           = null;
            this.thematic1502.Location        = new System.Drawing.Point(0, 0);
            this.thematic1502.Movable         = true;
            this.thematic1502.Name            = "thematic1502";
            this.thematic1502.NoRounding      = false;
            this.thematic1502.Sizable         = false;
            this.thematic1502.Size            = new System.Drawing.Size(732, 775);
            this.thematic1502.SmartBounds     = true;
            this.thematic1502.StartPosition   = System.Windows.Forms.FormStartPosition.WindowsDefaultLocation;
            this.thematic1502.TabIndex        = 1;
            this.thematic1502.Text            = "Brush Painter";
            this.thematic1502.TransparencyKey = System.Drawing.Color.Empty;
            this.thematic1502.Transparent     = false;
            //
            // CloseBtn
            //
            this.CloseBtn.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.CloseBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(34)))), ((int)(((byte)(34)))), ((int)(((byte)(34)))));
            this.CloseBtn.Cursor    = System.Windows.Forms.Cursors.Hand;
            this.CloseBtn.FlatAppearance.BorderSize = 0;
            this.CloseBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.CloseBtn.Font      = new System.Drawing.Font("Segoe UI", 8F);
            this.CloseBtn.ForeColor = System.Drawing.SystemColors.HighlightText;
            this.CloseBtn.Location  = new System.Drawing.Point(713, 4);
            this.CloseBtn.Name      = "CloseBtn";
            this.CloseBtn.Size      = new System.Drawing.Size(15, 15);
            this.CloseBtn.TabIndex  = 12;
            this.CloseBtn.Text      = "x";
            this.CloseBtn.UseCompatibleTextRendering = true;
            this.CloseBtn.UseVisualStyleBackColor    = false;
            this.CloseBtn.Click += new System.EventHandler(this.CloseBtn_Click);
            //
            // cancelButton
            //
            this.cancelButton.BackColor    = System.Drawing.Color.Red;
            this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.cancelButton.FlatAppearance.BorderSize = 0;
            this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.cancelButton.ForeColor = System.Drawing.SystemColors.HighlightText;
            this.cancelButton.Location  = new System.Drawing.Point(114, 210);
            this.cancelButton.Name      = "cancelButton";
            this.cancelButton.Size      = new System.Drawing.Size(88, 43);
            this.cancelButton.TabIndex  = 8;
            this.cancelButton.Text      = "Cancel";
            this.cancelButton.UseVisualStyleBackColor = false;
            this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
            //
            // okButton
            //
            this.okButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(122)))), ((int)(((byte)(204)))));
            this.okButton.FlatAppearance.BorderSize = 0;
            this.okButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.okButton.ForeColor = System.Drawing.SystemColors.HighlightText;
            this.okButton.Location  = new System.Drawing.Point(22, 210);
            this.okButton.Name      = "okButton";
            this.okButton.Size      = new System.Drawing.Size(88, 43);
            this.okButton.TabIndex  = 7;
            this.okButton.Text      = "&OK";
            this.okButton.UseVisualStyleBackColor = false;
            this.okButton.Click += new System.EventHandler(this.okButton_Click);
            //
            // gradientGroupBox
            //
            this.gradientGroupBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(22)))), ((int)(((byte)(22)))));
            this.gradientGroupBox.Controls.Add(this.gradientEditor);
            this.gradientGroupBox.ForeColor = System.Drawing.SystemColors.ActiveCaption;
            this.gradientGroupBox.Location  = new System.Drawing.Point(246, 333);
            this.gradientGroupBox.Name      = "gradientGroupBox";
            this.gradientGroupBox.Size      = new System.Drawing.Size(460, 367);
            this.gradientGroupBox.TabIndex  = 11;
            this.gradientGroupBox.TabStop   = false;
            this.gradientGroupBox.Text      = " Gradient ";
            //
            // gradientEditor
            //
            this.gradientEditor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(22)))), ((int)(((byte)(22)))));
            colorBlend1.Colors            = new System.Drawing.Color[] {
                System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))),
                System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(0)))), ((int)(((byte)(128)))), ((int)(((byte)(0))))),
                System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(255)))))
            };
            colorBlend1.Positions = new float[] {
                0F,
                0.5F,
                1F
            };
            this.gradientEditor.Blend               = colorBlend1;
            this.gradientEditor.GradientBackColor   = System.Drawing.Color.White;
            this.gradientEditor.GradientBorderColor = System.Drawing.Color.DarkGray;
            this.gradientEditor.GradientHatchColor  = System.Drawing.Color.Black;
            this.gradientEditor.Location            = new System.Drawing.Point(6, 25);
            this.gradientEditor.Margin              = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.gradientEditor.MarkerBorderColor   = System.Drawing.Color.Black;
            this.gradientEditor.MarkerFillColor     = System.Drawing.Color.White;
            this.gradientEditor.MinimumSize         = new System.Drawing.Size(376, 157);
            this.gradientEditor.Name = "gradientEditor";
            this.gradientEditor.SelMarkerFillColor = System.Drawing.Color.Yellow;
            this.gradientEditor.Size     = new System.Drawing.Size(444, 328);
            this.gradientEditor.TabIndex = 12;
            //
            // hatchGroupBox
            //
            this.hatchGroupBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(22)))), ((int)(((byte)(22)))));
            this.hatchGroupBox.Controls.Add(this.label4);
            this.hatchGroupBox.Controls.Add(this.backAlphaNud);
            this.hatchGroupBox.Controls.Add(this.label1);
            this.hatchGroupBox.Controls.Add(this.hatchAlphaNud);
            this.hatchGroupBox.Controls.Add(this.hatchComboBox);
            this.hatchGroupBox.Controls.Add(this.sampleHatchPanel);
            this.hatchGroupBox.Controls.Add(this.hatchPatternTextLabel);
            this.hatchGroupBox.Controls.Add(this.backColorButton);
            this.hatchGroupBox.Controls.Add(this.backColorLabel);
            this.hatchGroupBox.Controls.Add(this.backColorTextLabel);
            this.hatchGroupBox.Controls.Add(this.hatchColorButton);
            this.hatchGroupBox.Controls.Add(this.hatchColorLabel);
            this.hatchGroupBox.Controls.Add(this.hatchColorTextLabel);
            this.hatchGroupBox.ForeColor = System.Drawing.SystemColors.ActiveCaption;
            this.hatchGroupBox.Location  = new System.Drawing.Point(246, 136);
            this.hatchGroupBox.Name      = "hatchGroupBox";
            this.hatchGroupBox.Size      = new System.Drawing.Size(460, 191);
            this.hatchGroupBox.TabIndex  = 10;
            this.hatchGroupBox.TabStop   = false;
            this.hatchGroupBox.Text      = " Hatch pattern ";
            //
            // label4
            //
            this.label4.AutoSize  = true;
            this.label4.ForeColor = System.Drawing.Color.White;
            this.label4.Location  = new System.Drawing.Point(8, 124);
            this.label4.Name      = "label4";
            this.label4.Size      = new System.Drawing.Size(47, 19);
            this.label4.TabIndex  = 15;
            this.label4.Text      = "Alpha:";
            this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            //
            // backAlphaNud
            //
            this.backAlphaNud.BackColor   = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(22)))), ((int)(((byte)(22)))));
            this.backAlphaNud.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.backAlphaNud.Font        = new System.Drawing.Font("Segoe UI", 10F);
            this.backAlphaNud.ForeColor   = System.Drawing.Color.White;
            this.backAlphaNud.Increment   = new decimal(new int[] {
                5,
                0,
                0,
                0
            });
            this.backAlphaNud.Location = new System.Drawing.Point(135, 123);
            this.backAlphaNud.Maximum  = new decimal(new int[] {
                255,
                0,
                0,
                0
            });
            this.backAlphaNud.Name      = "backAlphaNud";
            this.backAlphaNud.Size      = new System.Drawing.Size(72, 25);
            this.backAlphaNud.TabIndex  = 16;
            this.backAlphaNud.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
            this.backAlphaNud.Value     = new decimal(new int[] {
                255,
                0,
                0,
                0
            });
            this.backAlphaNud.ValueChanged += new System.EventHandler(this.hatchAlphaNud_ValueChanged);
            //
            // label1
            //
            this.label1.AutoSize  = true;
            this.label1.ForeColor = System.Drawing.Color.White;
            this.label1.Location  = new System.Drawing.Point(8, 63);
            this.label1.Name      = "label1";
            this.label1.Size      = new System.Drawing.Size(47, 19);
            this.label1.TabIndex  = 12;
            this.label1.Text      = "Alpha:";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            //
            // hatchAlphaNud
            //
            this.hatchAlphaNud.BackColor   = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(22)))), ((int)(((byte)(22)))));
            this.hatchAlphaNud.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.hatchAlphaNud.Font        = new System.Drawing.Font("Segoe UI", 10F);
            this.hatchAlphaNud.ForeColor   = System.Drawing.Color.White;
            this.hatchAlphaNud.Increment   = new decimal(new int[] {
                5,
                0,
                0,
                0
            });
            this.hatchAlphaNud.Location = new System.Drawing.Point(135, 59);
            this.hatchAlphaNud.Maximum  = new decimal(new int[] {
                255,
                0,
                0,
                0
            });
            this.hatchAlphaNud.Name      = "hatchAlphaNud";
            this.hatchAlphaNud.Size      = new System.Drawing.Size(72, 25);
            this.hatchAlphaNud.TabIndex  = 13;
            this.hatchAlphaNud.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
            this.hatchAlphaNud.Value     = new decimal(new int[] {
                255,
                0,
                0,
                0
            });
            this.hatchAlphaNud.ValueChanged += new System.EventHandler(this.hatchAlphaNud_ValueChanged);
            //
            // hatchComboBox
            //
            this.hatchComboBox.BackColor         = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(22)))), ((int)(((byte)(22)))));
            this.hatchComboBox.FlatStyle         = System.Windows.Forms.FlatStyle.Flat;
            this.hatchComboBox.ForeColor         = System.Drawing.SystemColors.GrayText;
            this.hatchComboBox.FormattingEnabled = true;
            this.hatchComboBox.Location          = new System.Drawing.Point(135, 157);
            this.hatchComboBox.Name = "hatchComboBox";
            this.hatchComboBox.SelectedHatchStyle = System.Drawing.Drawing2D.HatchStyle.Horizontal;
            this.hatchComboBox.Size                  = new System.Drawing.Size(96, 26);
            this.hatchComboBox.TabIndex              = 10;
            this.hatchComboBox.SelectedIndexChanged += new System.EventHandler(this.hatchComboBox_SelectedIndexChanged);
            //
            // sampleHatchPanel
            //
            this.sampleHatchPanel.BackColor  = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(22)))), ((int)(((byte)(22)))));
            this.sampleHatchPanel.HatchColor = System.Drawing.Color.Gray;
            this.sampleHatchPanel.HatchStyle = System.Drawing.Drawing2D.HatchStyle.LargeGrid;
            this.sampleHatchPanel.Location   = new System.Drawing.Point(275, 24);
            this.sampleHatchPanel.Name       = "sampleHatchPanel";
            this.sampleHatchPanel.Size       = new System.Drawing.Size(177, 161);
            this.sampleHatchPanel.TabIndex   = 9;
            //
            // hatchPatternTextLabel
            //
            this.hatchPatternTextLabel.AutoSize  = true;
            this.hatchPatternTextLabel.ForeColor = System.Drawing.Color.White;
            this.hatchPatternTextLabel.Location  = new System.Drawing.Point(8, 157);
            this.hatchPatternTextLabel.Name      = "hatchPatternTextLabel";
            this.hatchPatternTextLabel.Size      = new System.Drawing.Size(97, 19);
            this.hatchPatternTextLabel.TabIndex  = 7;
            this.hatchPatternTextLabel.Text      = "Hatch pattern:";
            this.hatchPatternTextLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            //
            // backColorButton
            //
            this.backColorButton.BackgroundImage            = ((System.Drawing.Image)(resources.GetObject("backColorButton.BackgroundImage")));
            this.backColorButton.BackgroundImageLayout      = System.Windows.Forms.ImageLayout.Center;
            this.backColorButton.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56)))));
            this.backColorButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.backColorButton.Location  = new System.Drawing.Point(208, 94);
            this.backColorButton.Name      = "backColorButton";
            this.backColorButton.Size      = new System.Drawing.Size(24, 23);
            this.backColorButton.TabIndex  = 6;
            this.backColorButton.UseVisualStyleBackColor = true;
            this.backColorButton.Click      += new System.EventHandler(this.backColorButton_Click);
            this.backColorButton.MouseEnter += new System.EventHandler(this.backColorButton_MouseEnter);
            this.backColorButton.MouseLeave += new System.EventHandler(this.backColorButton_MouseLeave);
            //
            // backColorLabel
            //
            this.backColorLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.backColorLabel.ForeColor   = System.Drawing.Color.White;
            this.backColorLabel.Location    = new System.Drawing.Point(135, 94);
            this.backColorLabel.Name        = "backColorLabel";
            this.backColorLabel.Size        = new System.Drawing.Size(72, 23);
            this.backColorLabel.TabIndex    = 5;
            this.backColorLabel.TextAlign   = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // backColorTextLabel
            //
            this.backColorTextLabel.AutoSize  = true;
            this.backColorTextLabel.ForeColor = System.Drawing.Color.White;
            this.backColorTextLabel.Location  = new System.Drawing.Point(8, 94);
            this.backColorTextLabel.Name      = "backColorTextLabel";
            this.backColorTextLabel.Size      = new System.Drawing.Size(78, 19);
            this.backColorTextLabel.TabIndex  = 4;
            this.backColorTextLabel.Text      = "Back color: ";
            this.backColorTextLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            //
            // hatchColorButton
            //
            this.hatchColorButton.BackgroundImage            = ((System.Drawing.Image)(resources.GetObject("hatchColorButton.BackgroundImage")));
            this.hatchColorButton.BackgroundImageLayout      = System.Windows.Forms.ImageLayout.Center;
            this.hatchColorButton.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56)))));
            this.hatchColorButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.hatchColorButton.Location  = new System.Drawing.Point(208, 24);
            this.hatchColorButton.Name      = "hatchColorButton";
            this.hatchColorButton.Size      = new System.Drawing.Size(24, 24);
            this.hatchColorButton.TabIndex  = 3;
            this.hatchColorButton.UseVisualStyleBackColor = true;
            this.hatchColorButton.Click      += new System.EventHandler(this.hatchColorButton_Click);
            this.hatchColorButton.MouseEnter += new System.EventHandler(this.hatchColorButton_MouseEnter);
            this.hatchColorButton.MouseLeave += new System.EventHandler(this.hatchColorButton_MouseLeave);
            //
            // hatchColorLabel
            //
            this.hatchColorLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.hatchColorLabel.ForeColor   = System.Drawing.Color.White;
            this.hatchColorLabel.Location    = new System.Drawing.Point(135, 24);
            this.hatchColorLabel.Name        = "hatchColorLabel";
            this.hatchColorLabel.Size        = new System.Drawing.Size(72, 24);
            this.hatchColorLabel.TabIndex    = 2;
            this.hatchColorLabel.TextAlign   = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // hatchColorTextLabel
            //
            this.hatchColorTextLabel.AutoSize  = true;
            this.hatchColorTextLabel.ForeColor = System.Drawing.Color.White;
            this.hatchColorTextLabel.Location  = new System.Drawing.Point(8, 24);
            this.hatchColorTextLabel.Name      = "hatchColorTextLabel";
            this.hatchColorTextLabel.Size      = new System.Drawing.Size(86, 19);
            this.hatchColorTextLabel.TabIndex  = 1;
            this.hatchColorTextLabel.Text      = "Hatch color: ";
            this.hatchColorTextLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            //
            // solidGroupBox
            //
            this.solidGroupBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(22)))), ((int)(((byte)(22)))));
            this.solidGroupBox.Controls.Add(this.sampleSolidPanel);
            this.solidGroupBox.Controls.Add(this.opacityPreLabel);
            this.solidGroupBox.Controls.Add(this.solidAlphaNud);
            this.solidGroupBox.Controls.Add(this.solidColorButton);
            this.solidGroupBox.Controls.Add(this.solidColorLabel);
            this.solidGroupBox.Controls.Add(this.solidColorTextLabel);
            this.solidGroupBox.ForeColor = System.Drawing.SystemColors.ActiveCaption;
            this.solidGroupBox.Location  = new System.Drawing.Point(246, 40);
            this.solidGroupBox.Name      = "solidGroupBox";
            this.solidGroupBox.Size      = new System.Drawing.Size(460, 88);
            this.solidGroupBox.TabIndex  = 9;
            this.solidGroupBox.TabStop   = false;
            this.solidGroupBox.Text      = " Solid (one color) ";
            //
            // sampleSolidPanel
            //
            this.sampleSolidPanel.Location  = new System.Drawing.Point(322, 21);
            this.sampleSolidPanel.Name      = "sampleSolidPanel";
            this.sampleSolidPanel.Size      = new System.Drawing.Size(128, 59);
            this.sampleSolidPanel.TabIndex  = 11;
            this.sampleSolidPanel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // opacityPreLabel
            //
            this.opacityPreLabel.ForeColor = System.Drawing.Color.White;
            this.opacityPreLabel.Location  = new System.Drawing.Point(48, 55);
            this.opacityPreLabel.Name      = "opacityPreLabel";
            this.opacityPreLabel.Size      = new System.Drawing.Size(48, 21);
            this.opacityPreLabel.TabIndex  = 9;
            this.opacityPreLabel.Text      = "Alpha:";
            this.opacityPreLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            //
            // solidAlphaNud
            //
            this.solidAlphaNud.BackColor   = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(22)))), ((int)(((byte)(22)))));
            this.solidAlphaNud.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.solidAlphaNud.Font        = new System.Drawing.Font("Segoe UI", 10F);
            this.solidAlphaNud.ForeColor   = System.Drawing.Color.White;
            this.solidAlphaNud.Increment   = new decimal(new int[] {
                5,
                0,
                0,
                0
            });
            this.solidAlphaNud.Location = new System.Drawing.Point(108, 55);
            this.solidAlphaNud.Maximum  = new decimal(new int[] {
                255,
                0,
                0,
                0
            });
            this.solidAlphaNud.Name      = "solidAlphaNud";
            this.solidAlphaNud.Size      = new System.Drawing.Size(72, 25);
            this.solidAlphaNud.TabIndex  = 10;
            this.solidAlphaNud.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
            this.solidAlphaNud.Value     = new decimal(new int[] {
                255,
                0,
                0,
                0
            });
            this.solidAlphaNud.ValueChanged += new System.EventHandler(this.solidAlphaNud_ValueChanged);
            //
            // solidColorButton
            //
            this.solidColorButton.BackgroundImage            = ((System.Drawing.Image)(resources.GetObject("solidColorButton.BackgroundImage")));
            this.solidColorButton.BackgroundImageLayout      = System.Windows.Forms.ImageLayout.Center;
            this.solidColorButton.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56)))));
            this.solidColorButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.solidColorButton.Location  = new System.Drawing.Point(181, 24);
            this.solidColorButton.Name      = "solidColorButton";
            this.solidColorButton.Size      = new System.Drawing.Size(24, 23);
            this.solidColorButton.TabIndex  = 3;
            this.solidColorButton.UseVisualStyleBackColor = true;
            this.solidColorButton.Click      += new System.EventHandler(this.solidColorButton_Click);
            this.solidColorButton.MouseEnter += new System.EventHandler(this.solidColorButton_MouseEnter);
            this.solidColorButton.MouseLeave += new System.EventHandler(this.solidColorButton_MouseLeave);
            //
            // solidColorLabel
            //
            this.solidColorLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.solidColorLabel.ForeColor   = System.Drawing.Color.White;
            this.solidColorLabel.Location    = new System.Drawing.Point(108, 24);
            this.solidColorLabel.Name        = "solidColorLabel";
            this.solidColorLabel.Size        = new System.Drawing.Size(72, 23);
            this.solidColorLabel.TabIndex    = 2;
            this.solidColorLabel.TextAlign   = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // solidColorTextLabel
            //
            this.solidColorTextLabel.ForeColor = System.Drawing.Color.White;
            this.solidColorTextLabel.Location  = new System.Drawing.Point(8, 24);
            this.solidColorTextLabel.Name      = "solidColorTextLabel";
            this.solidColorTextLabel.Size      = new System.Drawing.Size(88, 23);
            this.solidColorTextLabel.TabIndex  = 1;
            this.solidColorTextLabel.Text      = "Color: ";
            this.solidColorTextLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            //
            // typeGroupBox
            //
            this.typeGroupBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(22)))), ((int)(((byte)(22)))));
            this.typeGroupBox.Controls.Add(this.gradientRadioButton);
            this.typeGroupBox.Controls.Add(this.hatchRadioButton);
            this.typeGroupBox.Controls.Add(this.noneRadioButton);
            this.typeGroupBox.Controls.Add(this.solidRadioButton);
            this.typeGroupBox.ForeColor = System.Drawing.SystemColors.ActiveCaption;
            this.typeGroupBox.Location  = new System.Drawing.Point(22, 40);
            this.typeGroupBox.Name      = "typeGroupBox";
            this.typeGroupBox.Size      = new System.Drawing.Size(180, 164);
            this.typeGroupBox.TabIndex  = 6;
            this.typeGroupBox.TabStop   = false;
            this.typeGroupBox.Text      = " Fill Type ";
            //
            // gradientRadioButton
            //
            this.gradientRadioButton.AutoSize  = true;
            this.gradientRadioButton.ForeColor = System.Drawing.Color.White;
            this.gradientRadioButton.Location  = new System.Drawing.Point(18, 132);
            this.gradientRadioButton.Name      = "gradientRadioButton";
            this.gradientRadioButton.Size      = new System.Drawing.Size(80, 23);
            this.gradientRadioButton.TabIndex  = 3;
            this.gradientRadioButton.TabStop   = true;
            this.gradientRadioButton.Text      = "Gradient";
            this.gradientRadioButton.UseVisualStyleBackColor = true;
            this.gradientRadioButton.CheckedChanged         += new System.EventHandler(this.fillerTypeChanged);
            //
            // hatchRadioButton
            //
            this.hatchRadioButton.AutoSize  = true;
            this.hatchRadioButton.ForeColor = System.Drawing.Color.White;
            this.hatchRadioButton.Location  = new System.Drawing.Point(16, 96);
            this.hatchRadioButton.Name      = "hatchRadioButton";
            this.hatchRadioButton.Size      = new System.Drawing.Size(112, 23);
            this.hatchRadioButton.TabIndex  = 2;
            this.hatchRadioButton.TabStop   = true;
            this.hatchRadioButton.Text      = "Hatch pattern";
            this.hatchRadioButton.UseVisualStyleBackColor = true;
            this.hatchRadioButton.CheckedChanged         += new System.EventHandler(this.fillerTypeChanged);
            //
            // noneRadioButton
            //
            this.noneRadioButton.AutoSize  = true;
            this.noneRadioButton.ForeColor = System.Drawing.Color.White;
            this.noneRadioButton.Location  = new System.Drawing.Point(16, 24);
            this.noneRadioButton.Name      = "noneRadioButton";
            this.noneRadioButton.Size      = new System.Drawing.Size(143, 23);
            this.noneRadioButton.TabIndex  = 0;
            this.noneRadioButton.TabStop   = true;
            this.noneRadioButton.Text      = "None (transparent)";
            this.noneRadioButton.UseVisualStyleBackColor = true;
            this.noneRadioButton.CheckedChanged         += new System.EventHandler(this.fillerTypeChanged);
            //
            // solidRadioButton
            //
            this.solidRadioButton.AutoSize  = true;
            this.solidRadioButton.ForeColor = System.Drawing.Color.White;
            this.solidRadioButton.Location  = new System.Drawing.Point(16, 60);
            this.solidRadioButton.Name      = "solidRadioButton";
            this.solidRadioButton.Size      = new System.Drawing.Size(125, 23);
            this.solidRadioButton.TabIndex  = 1;
            this.solidRadioButton.TabStop   = true;
            this.solidRadioButton.Text      = "Solid (one color)";
            this.solidRadioButton.UseVisualStyleBackColor = true;
            this.solidRadioButton.CheckedChanged         += new System.EventHandler(this.fillerTypeChanged);
            //
            // BrushPainter2EditorDialog
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(thematic1502);
            this.ClientSize      = new System.Drawing.Size(732, 775);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Name            = "BrushPainter2EditorDialog";
            this.Text            = "BrushPainter2Dialog";
            this.thematic1502.ResumeLayout(false);
            this.gradientGroupBox.ResumeLayout(false);
            this.hatchGroupBox.ResumeLayout(false);
            this.hatchGroupBox.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.backAlphaNud)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.hatchAlphaNud)).EndInit();
            this.solidGroupBox.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.solidAlphaNud)).EndInit();
            this.typeGroupBox.ResumeLayout(false);
            this.typeGroupBox.PerformLayout();
            this.ResumeLayout(false);
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.Drawing.Drawing2D.ColorBlend colorBlend1 = new System.Drawing.Drawing2D.ColorBlend();
     this.colorGradientEditor = new Zeroit.Framework.MiscControls.HelperControls.Widgets.ColorGradientEditor();
     this.splitter            = new System.Windows.Forms.SplitContainer();
     this.cancelButton        = new System.Windows.Forms.Button();
     this.okButton            = new System.Windows.Forms.Button();
     ((System.ComponentModel.ISupportInitialize)(this.splitter)).BeginInit();
     this.splitter.Panel1.SuspendLayout();
     this.splitter.Panel2.SuspendLayout();
     this.splitter.SuspendLayout();
     this.SuspendLayout();
     //
     // colorGradientEditor
     //
     colorBlend1.Colors = new System.Drawing.Color[] {
         System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))),
         System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(0)))), ((int)(((byte)(128)))), ((int)(((byte)(0))))),
         System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(255)))))
     };
     colorBlend1.Positions = new float[] {
         0F,
         0.5F,
         1F
     };
     this.colorGradientEditor.Blend               = colorBlend1;
     this.colorGradientEditor.Dock                = System.Windows.Forms.DockStyle.Fill;
     this.colorGradientEditor.GradientBackColor   = System.Drawing.Color.White;
     this.colorGradientEditor.GradientBorderColor = System.Drawing.Color.DarkGray;
     this.colorGradientEditor.GradientHatchColor  = System.Drawing.Color.Black;
     this.colorGradientEditor.Location            = new System.Drawing.Point(0, 0);
     this.colorGradientEditor.MarkerBorderColor   = System.Drawing.Color.Black;
     this.colorGradientEditor.MarkerFillColor     = System.Drawing.Color.White;
     this.colorGradientEditor.MinimumSize         = new System.Drawing.Size(322, 120);
     this.colorGradientEditor.Name                = "colorGradientEditor";
     this.colorGradientEditor.SelMarkerFillColor  = System.Drawing.Color.Yellow;
     this.colorGradientEditor.Size                = new System.Drawing.Size(358, 160);
     this.colorGradientEditor.TabIndex            = 0;
     //
     // splitter
     //
     this.splitter.Dock            = System.Windows.Forms.DockStyle.Fill;
     this.splitter.FixedPanel      = System.Windows.Forms.FixedPanel.Panel2;
     this.splitter.IsSplitterFixed = true;
     this.splitter.Location        = new System.Drawing.Point(8, 8);
     this.splitter.Name            = "splitter";
     this.splitter.Orientation     = System.Windows.Forms.Orientation.Horizontal;
     //
     // splitter.Panel1
     //
     this.splitter.Panel1.Controls.Add(this.colorGradientEditor);
     //
     // splitter.Panel2
     //
     this.splitter.Panel2.Controls.Add(this.cancelButton);
     this.splitter.Panel2.Controls.Add(this.okButton);
     this.splitter.Size             = new System.Drawing.Size(358, 189);
     this.splitter.SplitterDistance = 160;
     this.splitter.TabIndex         = 1;
     //
     // cancelButton
     //
     this.cancelButton.DialogResult            = System.Windows.Forms.DialogResult.Cancel;
     this.cancelButton.Location                = new System.Drawing.Point(80, 0);
     this.cancelButton.Name                    = "cancelButton";
     this.cancelButton.Size                    = new System.Drawing.Size(75, 24);
     this.cancelButton.TabIndex                = 1;
     this.cancelButton.Text                    = "Cancel";
     this.cancelButton.UseVisualStyleBackColor = true;
     this.cancelButton.Click                  += new System.EventHandler(this.cancelButton_Click);
     //
     // okButton
     //
     this.okButton.Location = new System.Drawing.Point(0, 0);
     this.okButton.Name     = "okButton";
     this.okButton.Size     = new System.Drawing.Size(75, 24);
     this.okButton.TabIndex = 0;
     this.okButton.Text     = "OK";
     this.okButton.UseVisualStyleBackColor = true;
     this.okButton.Click += new System.EventHandler(this.okButton_Click);
     //
     // ColorGradientEditorDialog
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.CancelButton        = this.cancelButton;
     this.ClientSize          = new System.Drawing.Size(374, 205);
     this.Controls.Add(this.splitter);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
     this.MaximizeBox     = false;
     this.MinimizeBox     = false;
     this.MinimumSize     = new System.Drawing.Size(356, 200);
     this.Name            = "ColorGradientEditorDialog";
     this.Padding         = new System.Windows.Forms.Padding(8);
     this.Text            = "Color Gradient Editor";
     this.splitter.Panel1.ResumeLayout(false);
     this.splitter.Panel2.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.splitter)).EndInit();
     this.splitter.ResumeLayout(false);
     this.ResumeLayout(false);
 }
コード例 #41
0
        public System.Drawing.Brush GetDrawingBrush()
        {
            if (true /*_drawingbrush == null*/)
            {
                if (type == BrushType.Solid)
                {
                    _drawingbrush = new System.Drawing.SolidBrush(color_gradients[0.0f]);
                }
                else if (type == BrushType.Linear)
                {
                    System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(
                        start,
                        end,
                        System.Drawing.Color.Red,
                        System.Drawing.Color.Red
                        );

                    List <System.Drawing.Color> brush_colors = new List <System.Drawing.Color>();
                    List <float> brush_positions             = new List <float>();

                    foreach (var kvp in color_gradients)
                    {
                        brush_positions.Add(kvp.Key);
                        brush_colors.Add(kvp.Value);
                    }

                    System.Drawing.Drawing2D.ColorBlend color_blend = new System.Drawing.Drawing2D.ColorBlend();
                    color_blend.Colors        = brush_colors.ToArray();
                    color_blend.Positions     = brush_positions.ToArray();
                    brush.InterpolationColors = color_blend;

                    switch (wrap)
                    {
                    //case BrushWrap.None:
                    //    brush.WrapMode = System.Drawing.Drawing2D.WrapMode.Clamp;
                    //    break;
                    case BrushWrap.Repeat:
                        brush.WrapMode = System.Drawing.Drawing2D.WrapMode.Tile;
                        break;

                    case BrushWrap.Reflect:
                        brush.WrapMode = System.Drawing.Drawing2D.WrapMode.TileFlipXY;
                        break;
                    }

                    _drawingbrush = brush;
                }
                else if (type == BrushType.Radial)
                {
                    System.Drawing.Drawing2D.GraphicsPath g_path = new System.Drawing.Drawing2D.GraphicsPath();
                    g_path.AddEllipse(
                        new System.Drawing.RectangleF(
                            start.X,
                            start.Y,
                            end.X,
                            end.Y
                            ));

                    System.Drawing.Drawing2D.PathGradientBrush brush = new System.Drawing.Drawing2D.PathGradientBrush(
                        g_path
                        );

                    switch (wrap)
                    {
                    //// Clamp causes an exception, it's a bug in the Drawing Brush.
                    //case BrushWrap.None:
                    //    brush.WrapMode = System.Drawing.Drawing2D.WrapMode.Clamp;
                    //    break;
                    case BrushWrap.Repeat:
                        brush.WrapMode = System.Drawing.Drawing2D.WrapMode.Tile;
                        break;

                    case BrushWrap.Reflect:
                        brush.WrapMode = System.Drawing.Drawing2D.WrapMode.TileFlipXY;
                        break;
                    }

                    List <System.Drawing.Color> brush_colors = new List <System.Drawing.Color>();
                    List <float> brush_positions             = new List <float>();

                    foreach (var kvp in color_gradients)
                    {
                        brush_positions.Add(1.0f - kvp.Key);
                        brush_colors.Add(kvp.Value);
                    }

                    brush.CenterPoint = center;
                    //brush.CenterColor = brush_colors[0];

                    //brush.SurroundColors = brush_colors.ToArray();

                    brush_colors.Reverse();
                    brush_positions.Reverse();

                    System.Drawing.Drawing2D.ColorBlend color_blend = new System.Drawing.Drawing2D.ColorBlend();
                    color_blend.Colors        = brush_colors.ToArray();
                    color_blend.Positions     = brush_positions.ToArray();
                    brush.InterpolationColors = color_blend;

                    _drawingbrush = brush;
                }
                else
                {
                    _drawingbrush = new System.Drawing.SolidBrush(System.Drawing.Color.Transparent);
                }
            }

            return(_drawingbrush);
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.Drawing.Drawing2D.ColorBlend colorBlend2 = new System.Drawing.Drawing2D.ColorBlend();
     this.groupBox1 = new System.Windows.Forms.GroupBox();
     this.customFusion_GradColors0_Btn = new System.Windows.Forms.Button();
     this.customFusion_GradColors1_Btn = new System.Windows.Forms.Button();
     this.groupBox2 = new System.Windows.Forms.GroupBox();
     this.customFusion_Corner_Btn = new System.Windows.Forms.Button();
     this.groupBox3 = new System.Windows.Forms.GroupBox();
     this.customFusion_Hover_Btn = new System.Windows.Forms.Button();
     this.groupBox4 = new System.Windows.Forms.GroupBox();
     this.customFusion_BlendColor2_Btn = new System.Windows.Forms.Button();
     this.customFusion_BlendColor0_Btn = new System.Windows.Forms.Button();
     this.customFusion_BlendColor1_Btn = new System.Windows.Forms.Button();
     this.label5 = new System.Windows.Forms.Label();
     this.customFusion_BlendPos1_Numeric = new System.Windows.Forms.NumericUpDown();
     this.groupBox5 = new System.Windows.Forms.GroupBox();
     this.customFusion_BlendPos3_Numeric = new System.Windows.Forms.NumericUpDown();
     this.label2 = new System.Windows.Forms.Label();
     this.customFusion_BlendPos2_Numeric = new System.Windows.Forms.NumericUpDown();
     this.label1    = new System.Windows.Forms.Label();
     this.groupBox6 = new System.Windows.Forms.GroupBox();
     this.customFusion_Pressed_Btn = new System.Windows.Forms.Button();
     this.groupbox10 = new System.Windows.Forms.GroupBox();
     this.customFusion_Inactive_Btn = new System.Windows.Forms.Button();
     this.label6     = new System.Windows.Forms.Label();
     this.previewBtn = new Zeroit.Framework.ButtonThematic.Controls.FuturePreview();
     this.color      = new System.Windows.Forms.ColorDialog();
     this.groupBox1.SuspendLayout();
     this.groupBox2.SuspendLayout();
     this.groupBox3.SuspendLayout();
     this.groupBox4.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.customFusion_BlendPos1_Numeric)).BeginInit();
     this.groupBox5.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.customFusion_BlendPos3_Numeric)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.customFusion_BlendPos2_Numeric)).BeginInit();
     this.groupBox6.SuspendLayout();
     this.groupbox10.SuspendLayout();
     this.SuspendLayout();
     //
     // groupBox1
     //
     this.groupBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
     this.groupBox1.Controls.Add(this.customFusion_GradColors0_Btn);
     this.groupBox1.Controls.Add(this.customFusion_GradColors1_Btn);
     this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.groupBox1.Font      = new System.Drawing.Font("Segoe UI", 9F);
     this.groupBox1.ForeColor = System.Drawing.Color.White;
     this.groupBox1.Location  = new System.Drawing.Point(7, 103);
     this.groupBox1.Name      = "groupBox1";
     this.groupBox1.Size      = new System.Drawing.Size(110, 71);
     this.groupBox1.TabIndex  = 69;
     this.groupBox1.TabStop   = false;
     this.groupBox1.Text      = "Gradient Colors";
     //
     // customFusion_GradColors0_Btn
     //
     this.customFusion_GradColors0_Btn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(36)))), ((int)(((byte)(38)))));
     this.customFusion_GradColors0_Btn.Cursor    = System.Windows.Forms.Cursors.Hand;
     this.customFusion_GradColors0_Btn.FlatAppearance.BorderSize = 0;
     this.customFusion_GradColors0_Btn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.customFusion_GradColors0_Btn.ForeColor = System.Drawing.SystemColors.HighlightText;
     this.customFusion_GradColors0_Btn.Location  = new System.Drawing.Point(15, 24);
     this.customFusion_GradColors0_Btn.Name      = "customFusion_GradColors0_Btn";
     this.customFusion_GradColors0_Btn.Size      = new System.Drawing.Size(38, 33);
     this.customFusion_GradColors0_Btn.TabIndex  = 65;
     this.customFusion_GradColors0_Btn.UseVisualStyleBackColor = false;
     this.customFusion_GradColors0_Btn.Click += new System.EventHandler(this.customFusion_GradColors0_Btn_Click);
     //
     // customFusion_GradColors1_Btn
     //
     this.customFusion_GradColors1_Btn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(70)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
     this.customFusion_GradColors1_Btn.Cursor    = System.Windows.Forms.Cursors.Hand;
     this.customFusion_GradColors1_Btn.FlatAppearance.BorderSize = 0;
     this.customFusion_GradColors1_Btn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.customFusion_GradColors1_Btn.ForeColor = System.Drawing.SystemColors.HighlightText;
     this.customFusion_GradColors1_Btn.Location  = new System.Drawing.Point(60, 24);
     this.customFusion_GradColors1_Btn.Name      = "customFusion_GradColors1_Btn";
     this.customFusion_GradColors1_Btn.Size      = new System.Drawing.Size(38, 33);
     this.customFusion_GradColors1_Btn.TabIndex  = 66;
     this.customFusion_GradColors1_Btn.UseVisualStyleBackColor = false;
     this.customFusion_GradColors1_Btn.Click += new System.EventHandler(this.customFusion_GradColors1_Btn_Click);
     //
     // groupBox2
     //
     this.groupBox2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
     this.groupBox2.Controls.Add(this.customFusion_Corner_Btn);
     this.groupBox2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.groupBox2.Font      = new System.Drawing.Font("Segoe UI", 9F);
     this.groupBox2.ForeColor = System.Drawing.Color.White;
     this.groupBox2.Location  = new System.Drawing.Point(224, 180);
     this.groupBox2.Name      = "groupBox2";
     this.groupBox2.Size      = new System.Drawing.Size(68, 71);
     this.groupBox2.TabIndex  = 70;
     this.groupBox2.TabStop   = false;
     this.groupBox2.Text      = "Corner";
     //
     // customFusion_Corner_Btn
     //
     this.customFusion_Corner_Btn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(36)))), ((int)(((byte)(38)))));
     this.customFusion_Corner_Btn.Cursor    = System.Windows.Forms.Cursors.Hand;
     this.customFusion_Corner_Btn.FlatAppearance.BorderSize = 0;
     this.customFusion_Corner_Btn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.customFusion_Corner_Btn.ForeColor = System.Drawing.SystemColors.HighlightText;
     this.customFusion_Corner_Btn.Location  = new System.Drawing.Point(15, 24);
     this.customFusion_Corner_Btn.Name      = "customFusion_Corner_Btn";
     this.customFusion_Corner_Btn.Size      = new System.Drawing.Size(38, 33);
     this.customFusion_Corner_Btn.TabIndex  = 65;
     this.customFusion_Corner_Btn.UseVisualStyleBackColor = false;
     this.customFusion_Corner_Btn.Click += new System.EventHandler(this.customFusion_Corner_Btn_Click);
     //
     // groupBox3
     //
     this.groupBox3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
     this.groupBox3.Controls.Add(this.customFusion_Hover_Btn);
     this.groupBox3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.groupBox3.Font      = new System.Drawing.Font("Segoe UI", 9F);
     this.groupBox3.ForeColor = System.Drawing.Color.White;
     this.groupBox3.Location  = new System.Drawing.Point(78, 180);
     this.groupBox3.Name      = "groupBox3";
     this.groupBox3.Size      = new System.Drawing.Size(66, 69);
     this.groupBox3.TabIndex  = 71;
     this.groupBox3.TabStop   = false;
     this.groupBox3.Text      = "Hover";
     //
     // customFusion_Hover_Btn
     //
     this.customFusion_Hover_Btn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(36)))), ((int)(((byte)(38)))));
     this.customFusion_Hover_Btn.Cursor    = System.Windows.Forms.Cursors.Hand;
     this.customFusion_Hover_Btn.FlatAppearance.BorderSize = 0;
     this.customFusion_Hover_Btn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.customFusion_Hover_Btn.ForeColor = System.Drawing.SystemColors.HighlightText;
     this.customFusion_Hover_Btn.Location  = new System.Drawing.Point(15, 24);
     this.customFusion_Hover_Btn.Name      = "customFusion_Hover_Btn";
     this.customFusion_Hover_Btn.Size      = new System.Drawing.Size(38, 33);
     this.customFusion_Hover_Btn.TabIndex  = 65;
     this.customFusion_Hover_Btn.UseVisualStyleBackColor = false;
     this.customFusion_Hover_Btn.Click += new System.EventHandler(this.customFusion_Hover_Btn_Click);
     //
     // groupBox4
     //
     this.groupBox4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
     this.groupBox4.Controls.Add(this.customFusion_BlendColor2_Btn);
     this.groupBox4.Controls.Add(this.customFusion_BlendColor0_Btn);
     this.groupBox4.Controls.Add(this.customFusion_BlendColor1_Btn);
     this.groupBox4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.groupBox4.Font      = new System.Drawing.Font("Segoe UI", 9F);
     this.groupBox4.ForeColor = System.Drawing.Color.White;
     this.groupBox4.Location  = new System.Drawing.Point(146, 105);
     this.groupBox4.Name      = "groupBox4";
     this.groupBox4.Size      = new System.Drawing.Size(147, 69);
     this.groupBox4.TabIndex  = 70;
     this.groupBox4.TabStop   = false;
     this.groupBox4.Text      = "Blend Colors";
     //
     // customFusion_BlendColor2_Btn
     //
     this.customFusion_BlendColor2_Btn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(70)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
     this.customFusion_BlendColor2_Btn.Cursor    = System.Windows.Forms.Cursors.Hand;
     this.customFusion_BlendColor2_Btn.FlatAppearance.BorderSize = 0;
     this.customFusion_BlendColor2_Btn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.customFusion_BlendColor2_Btn.ForeColor = System.Drawing.SystemColors.HighlightText;
     this.customFusion_BlendColor2_Btn.Location  = new System.Drawing.Point(99, 24);
     this.customFusion_BlendColor2_Btn.Name      = "customFusion_BlendColor2_Btn";
     this.customFusion_BlendColor2_Btn.Size      = new System.Drawing.Size(38, 33);
     this.customFusion_BlendColor2_Btn.TabIndex  = 67;
     this.customFusion_BlendColor2_Btn.UseVisualStyleBackColor = false;
     this.customFusion_BlendColor2_Btn.Click += new System.EventHandler(this.customFusion_BlendColor2_Btn_Click);
     //
     // customFusion_BlendColor0_Btn
     //
     this.customFusion_BlendColor0_Btn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(36)))), ((int)(((byte)(38)))));
     this.customFusion_BlendColor0_Btn.Cursor    = System.Windows.Forms.Cursors.Hand;
     this.customFusion_BlendColor0_Btn.FlatAppearance.BorderSize = 0;
     this.customFusion_BlendColor0_Btn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.customFusion_BlendColor0_Btn.ForeColor = System.Drawing.SystemColors.HighlightText;
     this.customFusion_BlendColor0_Btn.Location  = new System.Drawing.Point(11, 24);
     this.customFusion_BlendColor0_Btn.Name      = "customFusion_BlendColor0_Btn";
     this.customFusion_BlendColor0_Btn.Size      = new System.Drawing.Size(38, 33);
     this.customFusion_BlendColor0_Btn.TabIndex  = 65;
     this.customFusion_BlendColor0_Btn.UseVisualStyleBackColor = false;
     this.customFusion_BlendColor0_Btn.Click += new System.EventHandler(this.customFusion_BlendColor0_Btn_Click);
     //
     // customFusion_BlendColor1_Btn
     //
     this.customFusion_BlendColor1_Btn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(70)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
     this.customFusion_BlendColor1_Btn.Cursor    = System.Windows.Forms.Cursors.Hand;
     this.customFusion_BlendColor1_Btn.FlatAppearance.BorderSize = 0;
     this.customFusion_BlendColor1_Btn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.customFusion_BlendColor1_Btn.ForeColor = System.Drawing.SystemColors.HighlightText;
     this.customFusion_BlendColor1_Btn.Location  = new System.Drawing.Point(55, 24);
     this.customFusion_BlendColor1_Btn.Name      = "customFusion_BlendColor1_Btn";
     this.customFusion_BlendColor1_Btn.Size      = new System.Drawing.Size(38, 33);
     this.customFusion_BlendColor1_Btn.TabIndex  = 66;
     this.customFusion_BlendColor1_Btn.UseVisualStyleBackColor = false;
     this.customFusion_BlendColor1_Btn.Click += new System.EventHandler(this.customFusion_BlendColor1_Btn_Click);
     //
     // label5
     //
     this.label5.AutoSize  = true;
     this.label5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
     this.label5.Font      = new System.Drawing.Font("Segoe UI", 9F);
     this.label5.ForeColor = System.Drawing.SystemColors.HighlightText;
     this.label5.Location  = new System.Drawing.Point(6, 31);
     this.label5.Name      = "label5";
     this.label5.Size      = new System.Drawing.Size(13, 15);
     this.label5.TabIndex  = 92;
     this.label5.Text      = "1";
     //
     // customFusion_BlendPos1_Numeric
     //
     this.customFusion_BlendPos1_Numeric.BackColor     = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
     this.customFusion_BlendPos1_Numeric.BorderStyle   = System.Windows.Forms.BorderStyle.FixedSingle;
     this.customFusion_BlendPos1_Numeric.DecimalPlaces = 2;
     this.customFusion_BlendPos1_Numeric.Font          = new System.Drawing.Font("Segoe UI", 11F);
     this.customFusion_BlendPos1_Numeric.ForeColor     = System.Drawing.SystemColors.ScrollBar;
     this.customFusion_BlendPos1_Numeric.Increment     = new decimal(new int[] {
         1,
         0,
         0,
         131072
     });
     this.customFusion_BlendPos1_Numeric.Location = new System.Drawing.Point(26, 26);
     this.customFusion_BlendPos1_Numeric.Maximum  = new decimal(new int[] {
         1,
         0,
         0,
         0
     });
     this.customFusion_BlendPos1_Numeric.Name      = "customFusion_BlendPos1_Numeric";
     this.customFusion_BlendPos1_Numeric.Size      = new System.Drawing.Size(53, 27);
     this.customFusion_BlendPos1_Numeric.TabIndex  = 91;
     this.customFusion_BlendPos1_Numeric.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
     this.customFusion_BlendPos1_Numeric.Value     = new decimal(new int[] {
         1,
         0,
         0,
         0
     });
     this.customFusion_BlendPos1_Numeric.ValueChanged += new System.EventHandler(this.customFusion_BlendPos1_Numeric_ValueChanged);
     //
     // groupBox5
     //
     this.groupBox5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
     this.groupBox5.Controls.Add(this.customFusion_BlendPos3_Numeric);
     this.groupBox5.Controls.Add(this.label2);
     this.groupBox5.Controls.Add(this.customFusion_BlendPos2_Numeric);
     this.groupBox5.Controls.Add(this.label1);
     this.groupBox5.Controls.Add(this.customFusion_BlendPos1_Numeric);
     this.groupBox5.Controls.Add(this.label5);
     this.groupBox5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.groupBox5.Font      = new System.Drawing.Font("Segoe UI", 9F);
     this.groupBox5.ForeColor = System.Drawing.Color.White;
     this.groupBox5.Location  = new System.Drawing.Point(7, 30);
     this.groupBox5.Name      = "groupBox5";
     this.groupBox5.Size      = new System.Drawing.Size(263, 69);
     this.groupBox5.TabIndex  = 71;
     this.groupBox5.TabStop   = false;
     this.groupBox5.Text      = "Blend Positions";
     //
     // customFusion_BlendPos3_Numeric
     //
     this.customFusion_BlendPos3_Numeric.BackColor     = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
     this.customFusion_BlendPos3_Numeric.BorderStyle   = System.Windows.Forms.BorderStyle.FixedSingle;
     this.customFusion_BlendPos3_Numeric.DecimalPlaces = 2;
     this.customFusion_BlendPos3_Numeric.Font          = new System.Drawing.Font("Segoe UI", 11F);
     this.customFusion_BlendPos3_Numeric.ForeColor     = System.Drawing.SystemColors.ScrollBar;
     this.customFusion_BlendPos3_Numeric.Increment     = new decimal(new int[] {
         1,
         0,
         0,
         131072
     });
     this.customFusion_BlendPos3_Numeric.Location = new System.Drawing.Point(203, 26);
     this.customFusion_BlendPos3_Numeric.Maximum  = new decimal(new int[] {
         1,
         0,
         0,
         0
     });
     this.customFusion_BlendPos3_Numeric.Minimum = new decimal(new int[] {
         1,
         0,
         0,
         0
     });
     this.customFusion_BlendPos3_Numeric.Name      = "customFusion_BlendPos3_Numeric";
     this.customFusion_BlendPos3_Numeric.Size      = new System.Drawing.Size(54, 27);
     this.customFusion_BlendPos3_Numeric.TabIndex  = 95;
     this.customFusion_BlendPos3_Numeric.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
     this.customFusion_BlendPos3_Numeric.Value     = new decimal(new int[] {
         1,
         0,
         0,
         0
     });
     this.customFusion_BlendPos3_Numeric.ValueChanged += new System.EventHandler(this.customFusion_BlendPos3_Numeric_ValueChanged);
     //
     // label2
     //
     this.label2.AutoSize  = true;
     this.label2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
     this.label2.Font      = new System.Drawing.Font("Segoe UI", 9F);
     this.label2.ForeColor = System.Drawing.SystemColors.HighlightText;
     this.label2.Location  = new System.Drawing.Point(186, 31);
     this.label2.Name      = "label2";
     this.label2.Size      = new System.Drawing.Size(13, 15);
     this.label2.TabIndex  = 96;
     this.label2.Text      = "3";
     //
     // customFusion_BlendPos2_Numeric
     //
     this.customFusion_BlendPos2_Numeric.BackColor     = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
     this.customFusion_BlendPos2_Numeric.BorderStyle   = System.Windows.Forms.BorderStyle.FixedSingle;
     this.customFusion_BlendPos2_Numeric.DecimalPlaces = 2;
     this.customFusion_BlendPos2_Numeric.Font          = new System.Drawing.Font("Segoe UI", 11F);
     this.customFusion_BlendPos2_Numeric.ForeColor     = System.Drawing.SystemColors.ScrollBar;
     this.customFusion_BlendPos2_Numeric.Increment     = new decimal(new int[] {
         1,
         0,
         0,
         131072
     });
     this.customFusion_BlendPos2_Numeric.Location = new System.Drawing.Point(115, 26);
     this.customFusion_BlendPos2_Numeric.Maximum  = new decimal(new int[] {
         1,
         0,
         0,
         0
     });
     this.customFusion_BlendPos2_Numeric.Name      = "customFusion_BlendPos2_Numeric";
     this.customFusion_BlendPos2_Numeric.Size      = new System.Drawing.Size(52, 27);
     this.customFusion_BlendPos2_Numeric.TabIndex  = 93;
     this.customFusion_BlendPos2_Numeric.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
     this.customFusion_BlendPos2_Numeric.Value     = new decimal(new int[] {
         1,
         0,
         0,
         0
     });
     this.customFusion_BlendPos2_Numeric.ValueChanged += new System.EventHandler(this.customFusion_BlendPos2_Numeric_ValueChanged);
     //
     // label1
     //
     this.label1.AutoSize  = true;
     this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
     this.label1.Font      = new System.Drawing.Font("Segoe UI", 9F);
     this.label1.ForeColor = System.Drawing.SystemColors.HighlightText;
     this.label1.Location  = new System.Drawing.Point(99, 30);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(13, 15);
     this.label1.TabIndex  = 94;
     this.label1.Text      = "2";
     //
     // groupBox6
     //
     this.groupBox6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
     this.groupBox6.Controls.Add(this.customFusion_Pressed_Btn);
     this.groupBox6.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.groupBox6.Font      = new System.Drawing.Font("Segoe UI", 9F);
     this.groupBox6.ForeColor = System.Drawing.Color.White;
     this.groupBox6.Location  = new System.Drawing.Point(149, 180);
     this.groupBox6.Name      = "groupBox6";
     this.groupBox6.Size      = new System.Drawing.Size(69, 69);
     this.groupBox6.TabIndex  = 66;
     this.groupBox6.TabStop   = false;
     this.groupBox6.Text      = "Pressed";
     //
     // customFusion_Pressed_Btn
     //
     this.customFusion_Pressed_Btn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(36)))), ((int)(((byte)(38)))));
     this.customFusion_Pressed_Btn.Cursor    = System.Windows.Forms.Cursors.Hand;
     this.customFusion_Pressed_Btn.FlatAppearance.BorderSize = 0;
     this.customFusion_Pressed_Btn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.customFusion_Pressed_Btn.ForeColor = System.Drawing.SystemColors.HighlightText;
     this.customFusion_Pressed_Btn.Location  = new System.Drawing.Point(15, 24);
     this.customFusion_Pressed_Btn.Name      = "customFusion_Pressed_Btn";
     this.customFusion_Pressed_Btn.Size      = new System.Drawing.Size(38, 33);
     this.customFusion_Pressed_Btn.TabIndex  = 65;
     this.customFusion_Pressed_Btn.UseVisualStyleBackColor = false;
     this.customFusion_Pressed_Btn.Click += new System.EventHandler(this.customFusion_Pressed_Btn_Click);
     //
     // groupbox10
     //
     this.groupbox10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
     this.groupbox10.Controls.Add(this.customFusion_Inactive_Btn);
     this.groupbox10.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.groupbox10.Font      = new System.Drawing.Font("Segoe UI", 9F);
     this.groupbox10.ForeColor = System.Drawing.Color.White;
     this.groupbox10.Location  = new System.Drawing.Point(7, 180);
     this.groupbox10.Name      = "groupbox10";
     this.groupbox10.Size      = new System.Drawing.Size(65, 69);
     this.groupbox10.TabIndex  = 72;
     this.groupbox10.TabStop   = false;
     this.groupbox10.Text      = "Inactive";
     //
     // customFusion_Inactive_Btn
     //
     this.customFusion_Inactive_Btn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(36)))), ((int)(((byte)(38)))));
     this.customFusion_Inactive_Btn.Cursor    = System.Windows.Forms.Cursors.Hand;
     this.customFusion_Inactive_Btn.FlatAppearance.BorderSize = 0;
     this.customFusion_Inactive_Btn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.customFusion_Inactive_Btn.ForeColor = System.Drawing.SystemColors.HighlightText;
     this.customFusion_Inactive_Btn.Location  = new System.Drawing.Point(15, 24);
     this.customFusion_Inactive_Btn.Name      = "customFusion_Inactive_Btn";
     this.customFusion_Inactive_Btn.Size      = new System.Drawing.Size(38, 33);
     this.customFusion_Inactive_Btn.TabIndex  = 65;
     this.customFusion_Inactive_Btn.UseVisualStyleBackColor = false;
     this.customFusion_Inactive_Btn.Click += new System.EventHandler(this.customFusion_Inactive_Btn_Click);
     //
     // label6
     //
     this.label6.AutoSize  = true;
     this.label6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(22)))), ((int)(((byte)(22)))));
     this.label6.Font      = new System.Drawing.Font("Verdana", 10F);
     this.label6.ForeColor = System.Drawing.Color.White;
     this.label6.Location  = new System.Drawing.Point(348, 29);
     this.label6.Name      = "label6";
     this.label6.Size      = new System.Drawing.Size(60, 17);
     this.label6.TabIndex  = 96;
     this.label6.Text      = "Preview";
     //
     // previewBtn
     //
     this.previewBtn.Colors = new Zeroit.Framework.ButtonThematic.ThemeManagers.Bloom[0];
     colorBlend2.Colors     = new System.Drawing.Color[] {
         System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(28)))), ((int)(((byte)(28))))),
         System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32))))),
         System.Drawing.Color.FromArgb(((int)(((byte)(24)))), ((int)(((byte)(24)))), ((int)(((byte)(24)))))
     };
     colorBlend2.Positions = new float[] {
         0F,
         0.5F,
         1F
     };
     this.previewBtn.CustomFusionBlend           = colorBlend2;
     this.previewBtn.CustomFusionCornerColor     = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
     this.previewBtn.CustomFusionDownBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(24)))), ((int)(((byte)(24)))), ((int)(((byte)(24)))));
     this.previewBtn.CustomFusionGradColors      = new System.Drawing.Color[] {
         System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40))))),
         System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))))
     };
     this.previewBtn.CustomFusionNoneBorderColor = System.Drawing.Color.Black;
     this.previewBtn.CustomFusionOverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(44)))), ((int)(((byte)(44)))), ((int)(((byte)(44)))));
     this.previewBtn.Customization     = "";
     this.previewBtn.Font              = new System.Drawing.Font("Verdana", 8F);
     this.previewBtn.Image             = null;
     this.previewBtn.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
     this.previewBtn.Location          = new System.Drawing.Point(308, 59);
     this.previewBtn.Name              = "previewBtn";
     this.previewBtn.NoRounding        = false;
     this.previewBtn.PixelOffsetMode   = System.Drawing.Drawing2D.PixelOffsetMode.None;
     this.previewBtn.Size              = new System.Drawing.Size(130, 40);
     this.previewBtn.Smoothing         = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
     this.previewBtn.TabIndex          = 97;
     this.previewBtn.Text              = "futurePreview1";
     this.previewBtn.TextRendering     = System.Drawing.Text.TextRenderingHint.SystemDefault;
     this.previewBtn.Transparent       = false;
     //
     // UserControl_Future
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.BackColor           = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
     this.BorderStyle         = System.Windows.Forms.BorderStyle.FixedSingle;
     this.Controls.Add(this.previewBtn);
     this.Controls.Add(this.label6);
     this.Controls.Add(this.groupbox10);
     this.Controls.Add(this.groupBox6);
     this.Controls.Add(this.groupBox5);
     this.Controls.Add(this.groupBox4);
     this.Controls.Add(this.groupBox3);
     this.Controls.Add(this.groupBox2);
     this.Controls.Add(this.groupBox1);
     this.Name = "UserControl_Future";
     this.Size = new System.Drawing.Size(448, 281);
     this.groupBox1.ResumeLayout(false);
     this.groupBox2.ResumeLayout(false);
     this.groupBox3.ResumeLayout(false);
     this.groupBox4.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.customFusion_BlendPos1_Numeric)).EndInit();
     this.groupBox5.ResumeLayout(false);
     this.groupBox5.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.customFusion_BlendPos3_Numeric)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.customFusion_BlendPos2_Numeric)).EndInit();
     this.groupBox6.ResumeLayout(false);
     this.groupbox10.ResumeLayout(false);
     this.ResumeLayout(false);
     this.PerformLayout();
 }
コード例 #43
0
ファイル: BitmapButton.cs プロジェクト: unieagle/libpalaso
		/// <summary>
		/// This method fills the background of the button.
		/// </summary>
		/// <param name="e">paint arguments use to paint the button</param>
		private void paint_Background(PaintEventArgs e)
		{
			if(e == null)
				return;
			if(e.Graphics == null)
				return;

			Graphics g =e.Graphics;
			System.Drawing.Rectangle rect = new Rectangle(0,0,Size.Width,Size.Height);
			//
			// get color of background
			//
			System.Drawing.Color color = this.BackColor;;
			if(State == BtnState.Inactive)
				color = System.Drawing.Color.LightGray;
			//
			// intialize ColorArray and Positions Array
			//
			Color[] ColorArray     = null;
			float[] PositionArray  = null;
			//
			// initialize color array for a button that is pushed
			//
			if(State == BtnState.Pushed)
			{
				ColorArray = new Color[]{
									 Blend(this.BackColor,System.Drawing.Color.White,80),
									 Blend(this.BackColor,System.Drawing.Color.White,40),
									 Blend(this.BackColor,System.Drawing.Color.Black,0),
									 Blend(this.BackColor,System.Drawing.Color.Black,0),
									 Blend(this.BackColor,System.Drawing.Color.White,40),
									 Blend(this.BackColor,System.Drawing.Color.White,80),
				};
				PositionArray  = new float[]{0.0f,.05f,.40f,.60f,.95f,1.0f};
			}
			//
			// else, initialize color array for a button that is normal or disabled
			//
			else
			{
				ColorArray = new Color[]{
										 Blend(color,System.Drawing.Color.White,80),
										 Blend(color,System.Drawing.Color.White,90),
										 Blend(color,System.Drawing.Color.White,30),
										 Blend(color,System.Drawing.Color.White,00),
										 Blend(color,System.Drawing.Color.Black,30),
										 Blend(color,System.Drawing.Color.Black,20),
				};
				PositionArray  = new float[]{0.0f,.15f,.40f,.65f,.80f,1.0f};
			}
			//
			// create blend variable for the interpolate the colors
			//
			System.Drawing.Drawing2D.ColorBlend blend = new System.Drawing.Drawing2D.ColorBlend();
			blend.Colors    = ColorArray;
			blend.Positions = PositionArray;

			if (FlatStyle == FlatStyle.Flat)
			{
				using (var brush = new SolidBrush(BackColor))
				{
					g.FillRectangle(brush,rect);
				}
			}
			else
			{
				//
				// create vertical gradient brush
				//
				using(System.Drawing.Drawing2D.LinearGradientBrush brush =
					new System.Drawing.Drawing2D.LinearGradientBrush(rect, this.BackColor,
																	 Blend(this.BackColor, this.BackColor, 10),
																	 System.Drawing.Drawing2D.LinearGradientMode.
																		 Vertical))
				{
					brush.InterpolationColors = blend;
					g.FillRectangle(brush, rect);
				}
			}

		}
コード例 #44
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="PointCloud"></param>
        /// <param name="Message"></param>
        /// <returns></returns>
        public override bool Execute(ref PointCloud pointCloud)
        {
            #region - Initialize Execution
            //Set Global Variables
            LastPercentReported = 0;
            PointCounter        = 0;
            NewCloud            = new PointCloud();
            CloudPieces         = null;
            CloudPieces         = new PointCloud[ProcCount];
            GlobalCloud         = pointCloud;


            // Setup the cancellation mechanism.
            po.CancellationToken = cts.Token;

            //Create Partitions for multithreading.
            var rangePartitioner = System.Collections.Concurrent.Partitioner.Create(0, GlobalCloud.Count, (int)Math.Ceiling((double)GlobalCloud.Count / ProcCount));

            Dict_Utils.CastDictionary_ToArrayDouble(ref GlobalCloud);


            ////
            //Initialize ColorGradient
            Interval  Itv  = new Interval();
            Bitmap    bmp  = new Bitmap(1000, 1);
            Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);

            System.Drawing.Drawing2D.ColorBlend cb = new System.Drawing.Drawing2D.ColorBlend();
            float[] pos = new float[insV_Colors.Count];

            for (int i = 0; i <= pos.Length - 1; i += 1)
            {
                pos[i] = (float)insV_Values[i];
            }

            Color[] colors = insV_Colors.ToArray();
            Array.Sort(pos, colors);
            Array.Sort(pos, pos);
            float[] normpos = new float[insV_Colors.Count];
            Itv = new Interval(pos[0], pos[pos.Length - 1]);

            for (int i = 0; i <= normpos.Length - 1; i += 1)
            {
                normpos[i] = (float)Itv.NormalizedParameterAt(pos[i]);
            }

            cb.Positions = normpos;
            cb.Colors    = colors;


            System.Drawing.Drawing2D.LinearGradientBrush lin = new System.Drawing.Drawing2D.LinearGradientBrush(rect, Color.Black, Color.Black, 0, false);
            lin.LinearColors        = colors;
            lin.InterpolationColors = cb;


            ColVal = null;
            ColVal = new Color[bmp.Width];

            int counter = 0;

            using (Graphics g = Graphics.FromImage(bmp))
            {
                g.FillRectangle(lin, rect);
                for (int i = 0; i <= bmp.Width - 1; i += 1)
                {
                    Color col = bmp.GetPixel(i, 0);
                    ColVal[counter] = col;
                    counter        += 1;
                }
            }

            ////

            //Get Dictionary Values from PointCloud
            List <double> DictVal = new List <double>();
            DictVal.AddRange((double[])GlobalCloud.UserDictionary[insV_Key]);
            //Get idx to multiply with for normalized values.
            int idx = ColVal.Length - 1;

            //Run MultiThreaded Loop.
            Parallel.ForEach(rangePartitioner, po, (rng, loopState) =>
            {
                //Initialize Local Variables.
                /// Get Index for Processor to be able to merge clouds in ProcesserIndex order in the end.
                int MyIndex = (int)(rng.Item1 / Math.Ceiling(((double)GlobalCloud.Count / ProcCount)));
                /// Initialize Partial PointCloud
                PointCloud MyCloud = new PointCloud();

                /// Get Total Count Fraction to calculate Operation Percentage.
                double totc = (double)1 / GlobalCloud.Count;

                //Loop over individual RangePartitions per processor.
                for (int i = rng.Item1; i < rng.Item2; i++)
                {
                    //Operation Percentage Report
                    ///Safe Counter Increment.
                    Interlocked.Increment(ref PointCounter);
                    ///Calculate and Report Percentage.
                    if (LastPercentReported < ((PointCounter * totc) * 100))
                    {
                        LastPercentReported = (int)(5 * Math.Ceiling((double)(PointCounter * totc) * 20));
                        this.ReportPercent  = LastPercentReported;
                    }
                    #endregion - End of Initialize Execution

                    #region - Code to Process on PointCloud.


                    double thisnorm = new double();
                    if (insV_Step <= 0.0)
                    {
                        thisnorm = Itv.NormalizedParameterAt(DictVal[i]);
                    }
                    else
                    {
                        thisnorm = Itv.NormalizedParameterAt((Math.Floor((DictVal[i] - Itv[0]) / insV_Step) * insV_Step) + Itv[0]);
                    }

                    Color col = new Color();
                    if (thisnorm < (0.0000000))
                    {
                        col = ColVal.First();
                    }
                    else if (thisnorm > (1.0000000)) //+ Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance)
                    {
                        col = ColVal.Last();
                    }
                    else
                    {
                        col = ColVal[(int)(thisnorm * idx)];
                    }

                    if (insV_ColPct >= 0.0)
                    {
                        col = Color_Utils.Blend(GlobalCloud[i].Color, col, insV_ColPct);
                    }

                    MyCloud.Add(GlobalCloud[i].Location, col);


                    #endregion - End of Code to Process on PointCloud.
                    #region - Finalize Execution
                }



                //Add MyCloud to CloudPieces at ProcesserIndex.
                CloudPieces[(int)MyIndex] = MyCloud;

                //Enable Parrallel Computing Cancellation
                po.CancellationToken.ThrowIfCancellationRequested();
            }
                             );


            //Merge PointCloud Pieces into One PointCloud.
            Cloud_Utils.MergeClouds(ref NewCloud, CloudPieces);

            //Set UserDictionary from DictionaryLists.
            Dict_Utils.SetUserDict_FromOtherCloud(ref NewCloud, GlobalCloud);
            //Set ColorGradient UserData
            List <double> gradVals = new List <double>();
            List <Color>  gradCols = new List <Color>();
            if (insV_Step > 0.00)
            {
                for (int i = 0; i < pos.Length; i++)
                {
                    double gradVal = (Math.Floor((pos[i] - Itv[0]) / insV_Step) * insV_Step) + Itv[0];
                    if (!gradVals.Contains(gradVal))
                    {
                        Color gradCol = ColVal[(int)(Itv.NormalizedParameterAt(gradVal) * idx)];
                        gradVals.Add(gradVal);
                        gradCols.Add(gradCol);
                    }
                }
                double lastVal = (Math.Ceiling((pos[pos.Length - 1] - Itv[0]) / insV_Step) * insV_Step) + Itv[0];
                if (!gradVals.Contains(lastVal))
                {
                    Color gradCol = ColVal[(int)(Itv.NormalizedParameterAt(pos[pos.Length - 1]) * idx)];
                    gradVals.Add(lastVal);
                    gradCols.Add(gradCol);
                }
            }
            else
            {
                gradVals = insV_Values;
                gradCols = insV_Colors;
            }

            Color_Utils.Set_ColorGradient_Dict(ref NewCloud, gradCols, gradVals);

            //Dispose of Global Clouds.
            GlobalCloud.Dispose();
            pointCloud.Dispose();

            //Set OutputCloud
            pointCloud = (PointCloud)NewCloud.Duplicate();


            //Dispose of PointCloud Pieces and NewCloud.
            CloudPieces = null;
            NewCloud.Dispose();
            #endregion - End of Finalize Execution

            //Return True on Finish
            return(true);
        }
コード例 #45
0
ファイル: BitmapButton.cs プロジェクト: unieagle/libpalaso
		/// <summary>
		/// Paints a border around the image. If Image drop shadow is enabled,
		/// a shodow is drawn too.
		/// </summary>
		/// <param name="g">The graphics object</param>
		/// <param name="ImageRect">the rectangle region of the image</param>
		private void paint_ImageBorder(System.Drawing.Graphics g, System.Drawing.Rectangle ImageRect)
		{
			System.Drawing.Rectangle rect = ImageRect;

			//
			// If ImageDropShadow = true, draw shadow
			//
			if(ImageDropShadow)
			{
				System.Drawing.Pen p0 = new System.Drawing.Pen(System.Drawing.Color.FromArgb(80,0,0,0));
				System.Drawing.Pen p1 = new System.Drawing.Pen(System.Drawing.Color.FromArgb(40,0,0,0));
				g.DrawLine(p0, new Point(rect.Right,rect.Bottom),new Point(rect.Right+1,rect.Bottom));
				g.DrawLine(p0, new Point(rect.Right+1,rect.Top+1),new Point(rect.Right+1,rect.Bottom+0));
				g.DrawLine(p1, new Point(rect.Right+2,rect.Top+2),new Point(rect.Right+2,rect.Bottom+1));
				g.DrawLine(p0, new Point(rect.Left+1,rect.Bottom+1),new Point(rect.Right+0,rect.Bottom+1));
				g.DrawLine(p1, new Point(rect.Left+1,rect.Bottom+2),new Point(rect.Right+1,rect.Bottom+2));
			}
			//
			// Draw Image Border
			//
			if(ImageBorderEnabled)
			{
				Color[] ColorArray    = null;
				float[] PositionArray = null;
				System.Drawing.Color color = this.ImageBorderColor;
				if(!this.Enabled)
					color = System.Drawing.Color.LightGray;
				//
				// initialize color and position array
				//
				ColorArray = new Color[]{
											Blend(color,System.Drawing.Color.White,40),
											Blend(color,System.Drawing.Color.White,20),
											Blend(color,System.Drawing.Color.White,30),
											Blend(color,System.Drawing.Color.White,00),
											Blend(color,System.Drawing.Color.Black,30),
											Blend(color,System.Drawing.Color.Black,70),
				};
				PositionArray = new float[]{0.0f,.20f,.50f,.60f,.90f,1.0f};
				//
				// create blend object
				//
				System.Drawing.Drawing2D.ColorBlend blend = new System.Drawing.Drawing2D.ColorBlend();
				blend.Colors    = ColorArray;
				blend.Positions = PositionArray;
				//
				// create brush and pens
				//
				using(var brush = new System.Drawing.Drawing2D.LinearGradientBrush(rect, BackColor,
					Blend(BackColor, BackColor, 10), System.Drawing.Drawing2D.LinearGradientMode.Vertical))
				{
					brush.InterpolationColors = blend;
					using(var pen0 = new Pen(brush, 1))
					using(var pen1 = new Pen(Color.Black))
					{
						//
						// calculate points to draw line
						//
						rect.Inflate(1, 1);
						var pts = border_Get(rect.Left, rect.Top, rect.Width, rect.Height);
						border_Contract(1, ref pts);
						//
						// draw line 0
						//
						g.DrawLines(pen1, pts);
						//
						// draw line 1
						//
						border_Contract(1, ref pts);
						g.DrawLines(pen0, pts);
					}
				}
			}
		}
コード例 #46
0
ファイル: BrushUtils.cs プロジェクト: twigglius/Aurora
        public static System.Drawing.Brush MediaBrushToDrawingBrush(System.Windows.Media.Brush in_brush)
        {
            if (in_brush is System.Windows.Media.SolidColorBrush)
            {
                System.Drawing.SolidBrush brush = new System.Drawing.SolidBrush(
                    ColorUtils.MediaColorToDrawingColor((in_brush as System.Windows.Media.SolidColorBrush).Color)
                    );

                return(brush);
            }
            else if (in_brush is System.Windows.Media.LinearGradientBrush)
            {
                System.Windows.Media.LinearGradientBrush lgb = (in_brush as System.Windows.Media.LinearGradientBrush);

                System.Drawing.PointF starting_point = new System.Drawing.PointF(
                    (float)lgb.StartPoint.X,
                    (float)lgb.StartPoint.Y
                    );

                System.Drawing.PointF ending_point = new System.Drawing.PointF(
                    (float)lgb.EndPoint.X,
                    (float)lgb.EndPoint.Y
                    );

                System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(
                    starting_point,
                    ending_point,
                    System.Drawing.Color.Red,
                    System.Drawing.Color.Red
                    );

                /*
                 * switch(lgb.SpreadMethod)
                 * {
                 *  case System.Windows.Media.GradientSpreadMethod.Pad:
                 *      brush.WrapMode = System.Drawing.Drawing2D.WrapMode.Clamp;
                 *      break;
                 *  case System.Windows.Media.GradientSpreadMethod.Reflect:
                 *      brush.WrapMode = System.Drawing.Drawing2D.WrapMode.TileFlipXY;
                 *      break;
                 *  case System.Windows.Media.GradientSpreadMethod.Repeat:
                 *      brush.WrapMode = System.Drawing.Drawing2D.WrapMode.Tile;
                 *      break;
                 * }
                 */

                SortedDictionary <float, System.Drawing.Color> brush_blend = new SortedDictionary <float, System.Drawing.Color>();

                foreach (var grad_stop in lgb.GradientStops)
                {
                    if (!brush_blend.ContainsKey((float)grad_stop.Offset))
                    {
                        brush_blend.Add((float)grad_stop.Offset, ColorUtils.MediaColorToDrawingColor(grad_stop.Color));
                    }
                }

                List <System.Drawing.Color> brush_colors = new List <System.Drawing.Color>();
                List <float> brush_positions             = new List <float>();

                foreach (var kvp in brush_blend)
                {
                    brush_colors.Add(kvp.Value);
                    brush_positions.Add(kvp.Key);
                }

                System.Drawing.Drawing2D.ColorBlend color_blend = new System.Drawing.Drawing2D.ColorBlend();
                color_blend.Colors        = brush_colors.ToArray();
                color_blend.Positions     = brush_positions.ToArray();
                brush.InterpolationColors = color_blend;

                return(brush);
            }
            else if (in_brush is System.Windows.Media.RadialGradientBrush)
            {
                System.Windows.Media.RadialGradientBrush rgb = (in_brush as System.Windows.Media.RadialGradientBrush);

                System.Drawing.RectangleF brush_region = new System.Drawing.RectangleF(
                    0.0f,
                    0.0f,
                    2.0f * (float)rgb.RadiusX,
                    2.0f * (float)rgb.RadiusY
                    );

                System.Drawing.PointF center_point = new System.Drawing.PointF(
                    (float)rgb.Center.X,
                    (float)rgb.Center.Y
                    );

                System.Drawing.Drawing2D.GraphicsPath g_path = new System.Drawing.Drawing2D.GraphicsPath();
                g_path.AddEllipse(brush_region);

                System.Drawing.Drawing2D.PathGradientBrush brush = new System.Drawing.Drawing2D.PathGradientBrush(g_path);

                brush.CenterPoint = center_point;

                /*
                 * switch (rgb.SpreadMethod)
                 * {
                 *  case System.Windows.Media.GradientSpreadMethod.Pad:
                 *      brush.WrapMode = System.Drawing.Drawing2D.WrapMode.Clamp;
                 *      break;
                 *  case System.Windows.Media.GradientSpreadMethod.Reflect:
                 *      brush.WrapMode = System.Drawing.Drawing2D.WrapMode.TileFlipXY;
                 *      break;
                 *  case System.Windows.Media.GradientSpreadMethod.Repeat:
                 *      brush.WrapMode = System.Drawing.Drawing2D.WrapMode.Tile;
                 *      break;
                 * }
                 */

                SortedDictionary <float, System.Drawing.Color> brush_blend = new SortedDictionary <float, System.Drawing.Color>();

                foreach (var grad_stop in rgb.GradientStops)
                {
                    if (!brush_blend.ContainsKey((float)grad_stop.Offset))
                    {
                        brush_blend.Add((float)grad_stop.Offset, ColorUtils.MediaColorToDrawingColor(grad_stop.Color));
                    }
                }

                List <System.Drawing.Color> brush_colors = new List <System.Drawing.Color>();
                List <float> brush_positions             = new List <float>();

                foreach (var kvp in brush_blend)
                {
                    brush_colors.Add(kvp.Value);
                    brush_positions.Add(kvp.Key);
                }

                System.Drawing.Drawing2D.ColorBlend color_blend = new System.Drawing.Drawing2D.ColorBlend();
                color_blend.Colors        = brush_colors.ToArray();
                color_blend.Positions     = brush_positions.ToArray();
                brush.InterpolationColors = color_blend;

                return(brush);
            }
            else
            {
                return(new System.Drawing.SolidBrush(System.Drawing.Color.Red)); //Return error color
            }
        }