C# Make color transparent

private void buttonTransparent_Click(object sender, EventArgs e) { Bitmap bmp = (Bitmap)myPictureBox.Image; int X = int.Parse(lblX.Text) ; int Y = int.Parse(lblY.Text) ; Color SelectedColor = bmp.GetPixel(X,Y ); bmp.MakeTransparent(Color.FromArgb(SelectedColor.R, SelectedColor.G, SelectedColor.B)); // Change a color to be transparent myPictureBox.Image = bmp; }

C# Get Mouse Click Position and Selected Color

private void myPictureBox_MouseClick(object sender, MouseEventArgs e) { //Get bmp Dimension Bitmap bmp = (Bitmap)myPictureBox.Image; lblWidth.Text = bmp.Width.ToString(); lblHeight.Text = bmp.Height.ToString(); //Get Selected Color Color SelectedColor = bmp.GetPixel(e.X, e.Y); picSelectedColor.BackColor = SelectedColor; //Get MouseClick Position lblX.Text = e.X.ToString(); lblY.Text = e.Y.ToString(); //Get RGB Read More

C# Load Image to PictureBox

Learn From http://www.c-sharpcorner.com/UploadFile/0f68f2/color-detecting-in-an-image-in-C-Sharp/ private void BtnImportImage_Click(object sender, EventArgs e) { try { //Clean LblImagePath.Text = “”; myPictureBox.Image = null; //Choose File selection DialogResult IsResultOK = myOpenFileDialog.ShowDialog(); if (IsResultOK == System.Windows.Forms.DialogResult.OK) { //Get File name LblImagePath.Text = myOpenFileDialog.FileName; //Load Image into a picture Read More