C
C#2y ago
BurakD.

❔ Do Transparent All White Pixcel

private void button3_Click(object sender, EventArgs e) { // Bir resim seçme işlemi OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Resim Dosyaları|.jpg;.jpeg;.png;"; if (openFileDialog.ShowDialog() == DialogResult.OK) { // Resmi bir bitmap olarak yükleme Bitmap bitmap = new Bitmap(openFileDialog.FileName); for (int x = 0; x < bitmap.Width; x++) { for (int y = 0; y < bitmap.Height; y++) { // Pikselin rengini kontrol etme Color pixelColor = bitmap.GetPixel(x, y); if (pixelColor.R == 255 && pixelColor.G == 255 && pixelColor.B == 255) { // Pikseli siyah yapma bitmap.SetPixel(x, y, Color.Transparent);
} } // Değiştirilmiş resmi kaydetme } pictureBox1.Image = bitmap; SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "Resim Dosyaları|
.jpg;.jpeg;.png;"; if (saveFileDialog.ShowDialog() == DialogResult.OK) { bitmap.Save(saveFileDialog.FileName);
} } } }
2 Replies
BurakD.
BurakD.2y ago
What should be transparent turns white help please
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.