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 ;)
 
Back
Top