private void Weight_Gray_Click(object sender, EventArgs e) { PictureProcess w_gray = new PictureProcess(); pictureBox2.BackgroundImage = w_gray.weight_GrayScale((Bitmap)pictureBox2.BackgroundImage, 0.299, 0.587, 0.114); //更新新的width x height label2.Text = "編輯後" + w_gray.get_widthxHeight((Bitmap)pictureBox2.BackgroundImage); //把新的圖片狀態放進去stack裡面 picture_stack.Push((Bitmap)pictureBox2.BackgroundImage); }
private void Max_Gray_Click(object sender, EventArgs e) { //最大值 灰階 PictureProcess max_gray = new PictureProcess(); Bitmap n_background = max_gray.max_Grayscale((Bitmap)pictureBox2.BackgroundImage); pictureBox2.BackgroundImage = n_background; //更新新的width x height label2.Text = "編輯後" + max_gray.get_widthxHeight((Bitmap)pictureBox2.BackgroundImage); //把新的圖片狀態放進去stack裡面 picture_stack.Push((Bitmap)pictureBox2.BackgroundImage); }
private void button3_Click(object sender, EventArgs e) { PictureProcess change_size = new PictureProcess(); //get width and height string str_width = m_width.Text.ToString(), str_height = m_height.Text.ToString(); int int_width = Int32.Parse(str_width), int_height = Int32.Parse(str_height); pictureBox2.BackgroundImage = change_size.Resize((Bitmap)pictureBox2.BackgroundImage, int_width, int_height); //更新改變後 label的width x height label2.Text = "修改後" + change_size.get_widthxHeight((Bitmap)pictureBox2.BackgroundImage); //把新的圖片狀態放進去stack裡面 picture_stack.Push((Bitmap)pictureBox2.BackgroundImage); }