Пример #1
0
 private void initTooMuchPixels4()
 {
     frame.changeStatus("creating pixel - part 4");
     frame.Activate();
     frame.Focus();
     for (int x = (pixels.GetLength(1) / 4 * 3); x < pixels.GetLength(1); x++)
     {
         for (int y = 0; y < pixels.GetLength(0); y++)
         {
             pixels[y, x] = new PixelButton();
             pixels[y, x].BackColor = System.Drawing.Color.Transparent;
             pixels[y, x].FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             pixels[y, x].FlatAppearance.BorderSize = 0;
             pixels[y, x].Location = new System.Drawing.Point(0, 0);
             pixels[y, x].Margin = new System.Windows.Forms.Padding(0);
             pixels[y, x].Name = "pixel";
             pixels[y, x].Size = new System.Drawing.Size(4, 4);
             pixels[y, x].UseVisualStyleBackColor = false;
             pixels[y, x].setXY(y, x);
             pixels[y, x].Click += new System.EventHandler(this.pixels_Click);
             pixels[y, x].BackColorChanged += new System.EventHandler(this.pixels_Changed);
             this.designPanel.Controls.Add(pixels[y, x]);
         }
     }
     redrawTooMuchPixels4();
 }
Пример #2
0
 private void pixels_Click(object sender, EventArgs e)
 {
     if((sender is PixelButton)){
     selectpix = (PixelButton)sender;
     RedCount.Text = (map.GetPixel(selectpix.getX(), selectpix.getY()).R).ToString();
     GreenCount.Text = (map.GetPixel(selectpix.getX(), selectpix.getY()).G).ToString();
     BlueCount.Text = (map.GetPixel(selectpix.getX(), selectpix.getY()).B).ToString();
     AlphaCount.Text = (map.GetPixel(selectpix.getX(), selectpix.getY()).A).ToString();
     pixelInfo.Text = "像素資訊" + selectpix.getX() + "," + selectpix.getY();
     butColor.BackColor = map.GetPixel(selectpix.getX(), selectpix.getY());
     butClear.Enabled = true;
     }
 }
Пример #3
0
 private void initTooMuchPixels()
 {
     this.designPanel.Controls.Clear();
     frame = new Processing("Rendering " + pixels.GetLength(0) + "x" + pixels.GetLength(1) + " Image");
     frame.ShowInTaskbar = false;
     frame.Show();
     frame.Activate();
     frame.Focus();
     frame.changeStatus("creating pixel - part 1");
     for (int x = 0; x < pixels.GetLength(1) / 4; x++)
     {
         for (int y = 0; y < pixels.GetLength(0); y++)
         {
             frame.changeStatus("creating pixel" + x + "," + y);
             pixels[y, x] = new PixelButton();
             pixels[y, x].BackColor = System.Drawing.Color.Transparent;
             pixels[y, x].FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             pixels[y, x].FlatAppearance.BorderSize = 0;
             pixels[y, x].Location = new System.Drawing.Point(0, 0);
             pixels[y, x].Margin = new System.Windows.Forms.Padding(0);
             pixels[y, x].Name = "pixel";
             pixels[y, x].Size = new System.Drawing.Size(4, 4);
             pixels[y, x].UseVisualStyleBackColor = false;
             pixels[y, x].setXY(y, x);
             pixels[y, x].Click += new System.EventHandler(this.pixels_Click);
             pixels[y, x].BackColorChanged += new System.EventHandler(this.pixels_Changed);
             this.designPanel.Controls.Add(pixels[y, x]);
         }
     }
     this.designPanel.Size = new Size(514, 258);
     setSizeLabel();
     redrawTooMuchPixels();
     waitTimer.Start();
 }