I want to convert bitmap image to ushort?[] type. I am following this link but it does not serve the purpose as I dont require byte array.
Please help.
Solution
var shorts = Array.ConvertAll(croppedImageByteArray, b => (ushort?)b);
I want to convert bitmap image to ushort?[] type. I am following this link but it does not serve the purpose as I dont require byte array.
Please help.
Solution
var shorts = Array.ConvertAll(croppedImageByteArray, b => (ushort?)b);
Follow the same link and cast the bytes to ushort? On the final result where you have the byte array you can do
var WhatIWant = TheByteArray.Cast<ushort?>();
It's only useful if you specifically need that type, if you want to convert up from byte to a larger type to get more information that's a no go as that information doesn't exist to begin with if it's stored as bytes from the start.
If this doesn't help explain clearly what you are trying to do and most of all why so we can better help.