h0ppel
h0ppel

Reputation: 347

convert ushort[] grayscale values to byte[]

I have uhort[] values in the format 0-65536. But I need this grayscale values in byte form!

How can I convert my ushort values in byte values?

Thanks

Upvotes: 0

Views: 1011

Answers (1)

Hans Passant
Hans Passant

Reputation: 942247

 byte value = (byte)(array[index] >> 8);

Upvotes: 4

Related Questions