Как получить значение Alpha из пикселя в С# ⇐ C#
-
Anonymous
Как получить значение Alpha из пикселя в С#
I've been trying to simplify some images because I want to make a color by number game, thus I need pixilation and less colors, I've got most of that down, but still have problems with retrieving the colors from the image. Whenever I retrieve the color data from a pixel, it retrieves the R, G and B values, but not the A.
I've currently have it written this way, but this causes the A value of the color to always be 255, making brighter images extremely bad looking when I remake the image later.
Bitmap bm = new Bitmap(img); for (int i = 0; i < img.Height; i++) { for (int j = 0; j < img.Width; j++) { colors.Add(bm.GetPixel(j, i)); } }
Источник: https://stackoverflow.com/questions/780 ... in-c-sharp
I've been trying to simplify some images because I want to make a color by number game, thus I need pixilation and less colors, I've got most of that down, but still have problems with retrieving the colors from the image. Whenever I retrieve the color data from a pixel, it retrieves the R, G and B values, but not the A.
I've currently have it written this way, but this causes the A value of the color to always be 255, making brighter images extremely bad looking when I remake the image later.
Bitmap bm = new Bitmap(img); for (int i = 0; i < img.Height; i++) { for (int j = 0; j < img.Width; j++) { colors.Add(bm.GetPixel(j, i)); } }
Источник: https://stackoverflow.com/questions/780 ... in-c-sharp
Мобильная версия