Ejemplo n.º 1
0
 private void ColorWellDraw(object sender, PaintEventArgs e)
 {
     PSI_Palette.Palette p = this.Parent as PSI_Palette.Palette;
     if (p != null)
     {
         _color = Color.FromArgb(255, p.current_color);
     }
     e.Graphics.Clear(_color);
 }
Ejemplo n.º 2
0
 private void CM_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         pick_color = true;
         try
         {
             PSI_Palette.Palette p = (Palette)this.Parent;
             SetColor(p, e.Y);
         }
         catch (Exception e2)
         {
             Console.WriteLine(e2.Message);
         }
     }
 }
Ejemplo n.º 3
0
 private void CM_MouseMove(object sender, MouseEventArgs e)
 {
     try
     {
         if (e.Y >= 0 && e.Y <= Height)
         {
             PSI_Palette.Palette p = (Palette)this.Parent;
             if (pick_color)
             {
                 SetColor(p, e.Y);
             }
         }
     }
     catch (Exception e2)
     {
         Console.WriteLine(e2.Message);
     }
 }
Ejemplo n.º 4
0
 private void PalettePaint(object sender, PaintEventArgs e)
 {
     e.Graphics.Clear(System.Drawing.Color.FromArgb(0, 0, 0));
     e.Graphics.DrawImage(bm_output, new Rectangle(0, 0, Width, Height), new Rectangle(0, 0, xsize, ysize), GraphicsUnit.Pixel);
     if (show_alpha)
     {
         try
         {
             PSI_Palette.Palette p = (Palette)this.Parent;
             Brush b = new SolidBrush(p.current_color);
             e.Graphics.FillRectangle(b, 0, 0, Width, Height);
         }
         catch (Exception e2)
         {
             Console.WriteLine(e2.Message);
         }
     }
 }
Ejemplo n.º 5
0
 private void CM_MouseMove(object sender, MouseEventArgs e)
 {
     try
     {
         if (e.Button == MouseButtons.Left)
         {
             PSI_Palette.Palette p = (Palette)this.Parent;
             int x, y;
             x = (e.X * xsize) / Width;
             y = (e.Y * ysize) / Height;
             Color c = bm_output.GetPixel(x, y);
             p.current_color = System.Drawing.Color.FromArgb(nAlpha, c.R, c.G, c.B);
             //p.Refresh();
         }
     }
     catch (Exception e2)
     {
         Console.WriteLine(e2.Message);
     }
 }