stream image as hex

G

Guest

we are upgrading an old COM based app to .net - one thing we need to do is
convert an image to bin-hex and store that as text in a database. For
example, a bmp in the old app would be converted to something like this.

<SymbolDataStream
0032114D61706775696465204D4C462056312E301022000110A60000000900171102001011227FFF11660001FFFF000111E2FFFE00610000302200183046000000090017
</SymbolDataStream>

we need to duplicate this in .NET.
Any ideas?
 
K

Ken Cox [Microsoft MVP]

Hi Scott,

I think the XmlWriter should be able to do that for you. You'll want to look
at the XmlTextWriter.WriteBinHex Method
"Encodes the specified binary bytes as binhex and writes out the resulting
text.

http://msdn2.microsoft.com/en-us/library/fybw7359(en-US,VS.80).aspx

The documentation sample for WriteBase64 should give you the idea at
http://msdn2.microsoft.com/en-us/library/2532kztb

Also, check out the XmlTextWriter.WriteRaw Method

http://msdn2.microsoft.com/en-us/library/3xhh5ey9(en-US,VS.80).aspx

Ken
Microsoft MVP [ASP.NET]
 

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

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top