Re: Image <> String Problem
From: BluDog (news_at_nospam.bludog.net)
Date: 09/07/04
- Next message: CJ Taylor: "Re: How to send message to another instance of application ?"
- Previous message: Herfried K. Wagner [MVP]: "Re: Form show question Application.Run(New FooForm())"
- In reply to: Cor Ligthert: "Re: Image <> String Problem"
- Next in thread: Cor Ligthert: "Re: Image <> String Problem"
- Reply: Cor Ligthert: "Re: Image <> String Problem"
- Messages sorted by: [ date ] [ thread ]
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.
- Next message: CJ Taylor: "Re: How to send message to another instance of application ?"
- Previous message: Herfried K. Wagner [MVP]: "Re: Form show question Application.Run(New FooForm())"
- In reply to: Cor Ligthert: "Re: Image <> String Problem"
- Next in thread: Cor Ligthert: "Re: Image <> String Problem"
- Reply: Cor Ligthert: "Re: Image <> String Problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|