Horje
get color of pixel c# Code Example
c# get pixel color from image
using System.Drawing;

Bitmap img = new Bitmap("*imagePath*");
for (int i = 0; i < img.Width; i++)
{
    for (int j = 0; j < img.Height; j++)
    {
        Color pixel = img.GetPixel(i,j);
    }
} 
get color of pixel c#
static Color GetPixel(Point position)
{
	using (var bitmap = new Bitmap(1, 1))
	{
        using (var graphics = Graphics.FromImage(bitmap))
        {
            graphics.CopyFromScreen(position, new Point(0, 0), new Size(1, 1));
        }
    	return bitmap.GetPixel(0, 0);
	}
}
c# get pixel from bitmap click
private void pictureBox_MouseUp(object sender, MouseEventArgs e)
{
    Bitmap b = new Bitmap(pictureBox.Image);
    Color color = b.GetPixel(e.X, e.Y);
}




Csharp

Related
c# itext 7 PdfDocument from byte array Code Example c# itext 7 PdfDocument from byte array Code Example
convert uk string date to DateTime c# Code Example convert uk string date to DateTime c# Code Example
How to make game object transparent in unity Code Example How to make game object transparent in unity Code Example
return array in c# Code Example return array in c# Code Example
togl unity Code Example togl unity Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11