stream image as hex

Discussion in 'ASP .Net' started by =?Utf-8?B?U2NvdHQgRnJpZWRyaWNo?=, Oct 19, 2005.

  1. 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?
     
    =?Utf-8?B?U2NvdHQgRnJpZWRyaWNo?=, Oct 19, 2005
    #1
    1. Advertising

  2. 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]



    "Scott Friedrich" <> wrote in
    message news:...
    > 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?
     
    Ken Cox [Microsoft MVP], Oct 20, 2005
    #2
    1. Advertising

  3. Ken,

    Thanks a ton - I think the XmlTextWriter does the job.

    Scott
     
    =?Utf-8?B?U2NvdHQgRnJpZWRyaWNo?=, Oct 20, 2005
    #3
  4. =?Utf-8?B?U2NvdHQgRnJpZWRyaWNo?=

    Gabbar

    Joined:
    Mar 27, 2009
    Messages:
    1
    Convert Hex to Image

    Please help How to convert hex code to image.
     
    Gabbar, Mar 27, 2009
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    10
    Views:
    6,280
    Neredbojias
    Aug 19, 2005
  2. Bengt Richter
    Replies:
    6
    Views:
    489
    Juha Autero
    Aug 19, 2003
  3. jack
    Replies:
    4
    Views:
    596
  4. tim

    hex string to hex value

    tim, Nov 22, 2005, in forum: Python
    Replies:
    8
    Views:
    18,970
  5. tim
    Replies:
    2
    Views:
    1,586
    Dennis Lee Bieber
    Nov 23, 2005
Loading...

Share This Page