Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please Guide me i have data which is in ascii form.
First i need to convert into hexa then from hexa values generate image in .png

here are values which are in ascii form
$$,,,,47,070807080808070708090708080808080808080A0908080809090809080908090808080908090809090A0809090909090909090A0A090A090B0B090A0909080909090A090909090A0A0A090A0A0A090A09090A0A0A0A0A0A0A0A090B0A0A0A0C0B090A0C0B0A090A0A0B090A090A0A0A0A0B0A0B0A0909090A0A090A090A09090909080909080808090C0A09090908080808090908080808070706070707070706070607070706070708070808070607070707080707070708080708080808090808080808080708080908080809080908080809080807080808080808090808080808090808070808090909080908090808080909090909090A090A0A0A090908080809090909090909080909090909080908090908080809090808080807080709080807070607080807080807070805050607060605060607060606070606060606080707060707080707070706070708080807080707080807080808080808080809080808080908080808080708080808080808080708080808080807080807080908080808080A09090909080908090909090A0909090A09090909090A0809090A0909090A0A0A09090A0A09090808080808080707080807080808070807070708070706070607050606060606050606070606060606070607070706070606070707070707080807080808080807070809080808080808080808090809*


///////////hint
$$,,,,47, For header
*<cr><lf> For footer
Posted
Updated 11-Oct-13 22:19pm
v3

You can convert this to binary (not hexa, hex is what you see in the file), using the int.Parse method on successive pairs of hex digits, something like:
C#
//
// read the content of the file (ignoring header and footer)
// into the string "text"
//
// create an array large enough to hold the binary values
int size = text.Length / 2;
int[] binary = new int[size];
for (int i = 0; i < size; i++)
{
    string pair = text.Substring(i * 2, 2);
    int val = int.Parse(pair, NumberStyles.HexNumber);
    binary[i] = val;
}

You now have a copy of the binary content of your data.
 
Share this answer
 
Can you guide me how can i generate the image from these values
:(
I dont get your point they just sent me this code
$$,,,,47,070807080808070708090708080808080808080A0908080809090809080908090808080908090809090A0809090909090909090A0A090A090B0B090A0909080909090A090909090A0A0A090A0A0A090A09090A0A0A0A0A0A0A0A090B0A0A0A0C0B090A0C0B0A090A0A0B090A090A0A0A0A0B0A0B0A0909090A0A090A090A09090909080909080808090C0A09090908080808090908080808070706070707070706070607070706070708070808070607070707080707070708080708080808090808080808080708080908080809080908080809080807080808080808090808080808090808070808090909080908090808080909090909090A090A0A0A090908080809090909090909080909090909080908090908080809090808080807080709080807070607080807080807070805050607060605060607060606070606060606080707060707080707070706070708080807080707080807080808080808080809080808080908080808080708080808080808080708080808080807080807080908080808080A09090909080908090909090A0909090A09090909090A0809090A0909090A0A0A09090A0A09090808080808080707080807080808070807070708070706070607050606060606050606070606060606070607070706070606070707070707080807080808080807070809080808080808080808090809*<CR><LF>





HTML
1、Function description
Upload fingerprint features stored in the TZ_BUF 

2、Instruction format
Byte	1	2	3	4	5	6	7		8	9
Command	0x02	0x00	0x04	0x13	0x00	0x00	0x00	None	0x17	0x03
Command size	1	1	1	1	1	1	1	0	1	1
Instruction illustration:
0x02 0x00 0x04 0x13 0x00 0x00 0x00 0x17 0x03

3、Succeed response:
Byte	1	2	3	4	5			
Command	0x02	0x??	0x??	0x00	0x13	Fingerprint features	0x??	0x03
Command size	1	1	1	1	1	<=256	1	1
Note: Fingerprint features are capturing fingerprint features value, whose length is not longer than 256 bytes

4、Failed response:
Byte	1	2	3	4	5		6	7
Command	0x02	0x00	0x02	ECODE	0x13	None	0x??	0x03
Command size	1	1	1	1	1	0	1	1
 
Share this answer
 
v2
Comments
Richard MacCutchan 12-Oct-13 9:12am    
No idea what that means, you need to talk to the people who provide the data.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900