Как получить значение Alpha из пикселя в С#C#

Место общения программистов C#
Ответить
Anonymous
 Как получить значение Alpha из пикселя в С#

Сообщение Anonymous »


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
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C#»