I have a 1080P monitor. Doing
int j Screen.PrimaryScreen.Bounds.Width;
int k = Screen.PrimaryScreen.Bounds.Height;
_Bitmap.GetPixel(j, k).GetBrightness();
(_Bitmap size is equal to my screen bounds), it throws an exception saying "Parameter must be positive and < height".
Width and Height start counting at 1, the indexes used in GetPixel() start at 0. So when trying to acces the Pixel at (Width,Height) nothing is found
To correct the error change the code to (for example):
int width = Screen.PrimaryScreen.Bounds.Width;
int height = Screen.PrimaryScreen.Bounds.Height;
_Bitmap.GetPixel(width-1,height-1).GetBrightness();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With