0

Hi,

I have a constantly rotating image and i want to get the pixel at a specific point (where i click). The problem is that after the rotation the image won't update the bitmap with the new position, so the pixels will remain exactly the same whether the image is rotating or not. Is there a way to get the pixel at a given point while the image is rotating? Thanks in advance!!

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Momerath
0

You can use this to get the color of a pixel on the screen:

public Color GetColorAt(Point location) {
    Bitmap screenPixel = new Bitmap(1, 1);
    Graphics gfx = Graphics.FromImage((Image)screenPixel);
    gfx.CopyFromScreen(location.X, location.Y, 0, 0, new Size(1, 1));
    return screenPixel.GetPixel(0,0);
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.