Convert byte array to signed integer

Posted by Sudhakar_A under WPF on 12/2/2013 | Points: 10 | Views : 1978 | Status : [Member] | Replies : 5
How to convert byte array to signed integer in wpf using C#.net




Responses

Posted by: vishalneeraj-24503 on: 12/2/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Hi,please refer below links:-
http://msdn.microsoft.com/en-us/library/bb384066.aspx
http://stackoverflow.com/questions/3982384/convert-into-to-byte-array-and-insert-into-other-array
http://stackoverflow.com/questions/11654562/how-convert-byte-array-to-string

Sudhakar_A, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: vishalneeraj-24503 on: 12/2/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Also look at below URLs:-
http://stackoverflow.com/questions/553611/wpf-image-to-byte
http://stackoverflow.com/questions/15270844/how-can-i-convert-byte-to-bitmapimage
http://stackoverflow.com/questions/3801275/how-to-convert-image-in-byte-arrayhttp://stackoverflow.com/questions/3046784/byte-to-integer-in-c-sharp
http://www.c-sharpcorner.com/uploadfile/mahesh/convert-integer-to-byte-array-in-C-Sharp/
http://www.c-sharpcorner.com/uploadfile/b942f9/how-to-convert-unsigned-integer-arrays-to-signed-arrays-and-vice-versa/

Hope this helps you.

Sudhakar_A, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 12/3/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
refer
http://stackoverflow.com/questions/8104343/converting-3-bytes-into-signed-integer-in-c-sharp
http://stackoverflow.com/questions/6165171/convert-byte-array-to-int
http://stackoverflow.com/questions/10474186/c-sharp-byte-arrays-signed-unsigned-dilemma
http://msdn.microsoft.com/en-us/library/bb384066.aspx

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Sudhakar_A, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kmandapalli on: 12/3/2013 [Member] Silver | Points: 25

Up
0
Down
Hi,

For signed:

byte b2 = -1; // 0xFF
int i2 = b2; // 0xFFFFFFFF
int n = i2 << 8; // 0x0xFFFFFF00

For Unsigned:

byte b2 = -1; // 0xFF
int i2 = b2 & 0xFF; // 0x000000FF
int n = i2 << 8; // 0x0000FF00

Mark as answer if satisfied.....

Regards,
Shree M.

Kavya Shree Mandapalli

Sudhakar_A, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mack.Richards18 on: 1/21/2014 [Member] Starter | Points: 25

Up
0
Down
You can see the links to get the answer -

http://stackoverflow.com/questions/6165171/convert-byte-array-to-int
http://stackoverflow.com/questions/553611/wpf-image-to-byte

Sudhakar_A, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response