Re: Image <> String Problem

From: BluDog (news_at_nospam.bludog.net)
Date: 09/07/04


Date: Tue, 07 Sep 2004 16:37:02 +0100

Cor

Thanks, i can see this working, however in my application i want to
store the image as an XmlNode, the complete xml file looks like the
following:

- <Tags>
- <Tag id="e2c0fde4-f540-43e9-b0ac-0d7c94f2196f">
  <Checked>Unchecked</Checked>
  <Text>Test Tag</Text>
  <Expanded>True</Expanded>
  <Image type="base64Binary">JFIF

HHC    $.' ",#(7),01444'9=82<.342C
  2!!22222222222222222222222222222222222222222222222222

"






 



}

!1AQa"q2#BR$3br
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz

 




w

!1AQaq"2B #3Rbr
$4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz


??_^Nn+FQ.r8gSdG#N
Qc-tEAA_} +BI ?U</Image>
  </Tag>
  </Tags>

The example you have given illustratess how to store the image as a
file in it's own right and as in xml format through a dataset, my
problem is that i want it to be a tag within an existing xml document.

The problem is that somewhere and i am not sure where there is data
being lost i believe when turning the image into a string:

            Dim ms As New IO.MemoryStream
            Me.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg)
            Dim imageBytes() As Byte = ms.GetBuffer
            Dim imageString As String =
System.Text.Encoding.UTF8.GetString(imageBytes)
            Dim imageNode As XmlElement = CreateAppendElement(tagNode,
"Image")
            imageNode.SetAttribute("type", "base64Binary")
            imageNode.InnerText = imageString

I cannot find any references that create an xml representation of an
image as a part of a larger xml file.

Thanks

Blu.



Relevant Pages

  • Re: XML file to Database
    ... Is it that you want to store the XML into a single column in a table or do ... configuration information is lost. ... can I read the XML file into a database? ...
    (microsoft.public.sqlserver.programming)
  • Re: xml in plain text file on heavy load.
    ... even if the XML file is magically and perfectly ... I want to emphasize that IIS would never be caching that XML file on its own ... Application is NOT synchronizing access to your ASP pages. ...
    (microsoft.public.inetserver.iis)
  • Re: TAPI 3.0 call attached data
    ... The format of the Call Attached Data is XML. ... XML file with CallAttchedData represents one or multiple data lists ... Root element is CallAttachedData. ... version CDATA #FIXED "1.0" ...
    (microsoft.public.win32.programmer.tapi)
  • Re: GET MENU ITEM VALUE
    ... menu item on the fly and store a reference key in a hashtable or something. ... > The problem is that I am using an XML file to store the menu Item names so ... It is much easier to add it to an XML ... > changed information in it. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: XML parser and writer
    ... them on a calendar. ... Therefore I will need to both easily parse and write new XML files. ... why not some database technology? ... an advanced user can edit the XML file directly at ...
    (comp.lang.java.programmer)

Loading