|
Hello all member,
Please help me to convert images to unsigned char of array 2d data type by java code.
Ex: We have a file Test.png so I want to convert this file to unsigned char Test[][48]={{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}};
Thank you.
|
|
|
|
|
You need to explain in more detail what you mean. A file is simply a stream of bytes, so what exactly is your problem?
|
|
|
|
|
Hello,
I have a image file. (Test.png) I need algorithms convert this image to unsigned char Test[][]={{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}};
Formatting that.
Thank you for reply me!
|
|
|
|
|
Sorry but I still do not understand what you mean by 'convert'. A file (as I said previously) is merely a stream of bytes, so reading it into memory you automatically have an array. What exactly are you trying to do with this file's content?
Use the best guess
|
|
|
|
|
Hi,
I have one file test.png I want to convert to array 2d of hexadecimal.
Ex: test.png ---Convert----> unsigned char test [][]={{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}};
for Example,
Thank you for helping me..!
|
|
|
|
|
That is the third time you have posted exactly the same information which gives no explanation of what you mean by "convert". As I said before, if you read the file into memory it will be in an array of bytes, so what do you want to convert it to?
Use the best guess
|
|
|
|
|
Oh..!
For example: I have Test.bmp I want to convert it to hexadecimal of array 2d.
|
|
|
|
|
There is little point in you continuing to repeat the same sentence which makes no sense. I cannot repeat enough that a file (any file) is a 1-dimensional array of bytes, so what exactly are you trying to convert it into, and how do you expect to make it 2-dimensional?
Use the best guess
|
|
|
|
|
|
Do you mean you don't know what you want to do? In that case, what was the point of this thread?
Use the best guess
|
|
|
|
|