Use Hex to build image

  • Thread starter Thread starter NuBBeR
  • Start date Start date
N

NuBBeR

I have an image that has been broken down to hex and would like to rebuild
it from the resulting hex. Does anyone have any ideas? Thanks in advance!
 
Hi,
The hardest part of this is to convert the hex string to an array of
bytes. Please refer Neilck's article on Code Project for a class to do
this:

http://www.codeproject.com/csharp/hexencoding.asp

once that's done, the rest is fairly simple:

byte[] byteArray = HexEncoding.GetBytes(hexString, out discarded);
MemoryStream stream = new MemoryStream( byteArray );
Bitmap bitmap = new Bitmap( stream );
Hope this works or at least that it helps ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top