 |
|
|
 |
|
 |
I am trying to pars an XML file where there is an image associated with the componenet. (I think that I need to be able to open the image save it as a string) my XML reads somthing like this
<button ID = "1"> . . . <image> <imageid>1</imageid> <imagename>back</imagename> THIS is the bit that i can not pars at the momenet <horozontalalignment>0</horozontalalignment> </image> . . </button>
Can any one help please, I am having a mental block 
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
|
 |
|
|
 |
|
 |
So i have an app that manipulates images.
I can load an image and save it as XML, ok. I can then load the XML and extract the image, ok But then when I try to save it as XML again and get the error:
"An unhandled exception of type 'System.Runtime.InteropServices.ExternalException' occured in system.drawing.dll
Additional information: A generic error occurred in GDI+."
Any ideas? The image is a jpg, and is stored in a memory stream.
|
| Sign In·View Thread·PermaLink | 1.67/5 |
|
|
|
 |
|
 |
Hi, I have and XML document, dtd and xsl file stored as blobs within an Oracle database. I am using the following code within my web service to retrieve the blobs from the database, however I have no idea how to then load them into the XMLTextReader. Presumably the data returned in the dataset will need to be converted from binary into something the XMLTextReader will understand. I'm pretty new to .Net and would appreciate any help as I'm tearing my hair out over this one!!
My existing code:
string sSQL = "SELECT THE_FILE, THE_DTD, THE_XSL from WSTest"; OracleDataAdapter oDA = new OracleDataAdapter (sSQL,myConnection); OracleCommandBuilder oCB = new OracleCommandBuilder(oDA); DataSet oDs = new DataSet("WSTest"); oDA.MissingSchemaAction = MissingSchemaAction.AddWithKey; oDA.Fill(oDs,"WSTest"); DataRow oDR; oDR = oDs.Tables["WSTest"].NewRow(); oDR = oDs.Tables["WSTest"].Rows[0];
Thanks, Sharon
|
| Sign In·View Thread·PermaLink | 3.50/5 |
|
|
|
 |
|
 |
Hi. I want install a component in C++ Builder 6 but this component needs a file: dbconsts.obj, whitout it execute in C++ Builder 5. Please help me. Thanks.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I noticed in the code to this article that the author was looking for a better way to create the right size of byte array in which to store the image data when reading in the image from the xml. I dealt with this by including a size attribute in the xml element containing the image data
i.e. <imagedata size="284375">[image data]</imagedata>
You can then read this value just before extracting the data
int size = Int32.Parse(xml.GetAttribute("size")); byte[] imageData = new byte[size]; xml.ReadBase64(imageData,0,imageData.Length);
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
 |
If I already have the image loaded in memory, is there any way for me to get it shoved into a byte array? The obvious long way would be to save to disk and re-load it, but I'm sure there is a better way.....
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
 |
Yes,
just use
byte[] theByteArray = Convert.FromBase64String(string theString);
It works for me...

Kamen Nikolov
kamen.nik@sympatico.ca
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
If you have the image as an image object and not as an XML node, then use this:
MemoryStream memStream = new MemoryStream(); bitmapObject.Save(memStream, System.Drawing.Imaging.ImageFormat.Gif); int ImageSize = Convert.ToInt32(memStream.Length); byte[] ImageBytes = new byte[ImageSize]; memStream.Position=0; memStream.Read(ImageBytes, 0, ImageSize); memStream.Close(); return ImageBytes;
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
In vb6 with msxml3 i do the following code :
Set oElement = xmlDOMDocument.createElement("SIGNATURE") oRoot.appendChild oElement oElement.dataType = "bin.base64" oElement.nodeTypedValue = rsResult.Fields("Signature").Value
to assign binary data from one recordset to a MSXml Node
I try to do the same in C# using System.Xml, but i want a source code that don't use temprary files. I tried with the XmlTextWriter and XmlTextReader but I cant' make them work ... any ideas
Bruno Capuano Software Engineer PECTRA Technology Inc. All the Solutions in One Product +54(351)4245756 - int. 301 Pectra.Com
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hey people check it out XML Quik builder beta version from www.editml.com Its converts XSD to GUI in seconds and can be saved as XML make use of this tool, and save ur time
go to www.editml.com
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
 |
We don't take kindly to spammers in these here parts.
If you want an ad on CP, contact Chris for pricing details.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Remember that amateurs built the ark. Professionals built the Titanic.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I would like to encode the binary information in an xml document but i would prefer not to create a file. I would like to writer the xml to a string instead of a file. Any Ideas..
|
| Sign In·View Thread·PermaLink | 3.00/5 |
|
|
|
 |
|
|
 |
|
 |
Sounds goods.. But how do i do that with C#.. Will this allow me to take binary informaion an write to a string as base64.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
You could just do:
System.Convert.ToBase64String(myByteArray);
This should work in any .NET language.
Hope that helps....
--------------------------- Hmmm... what's a signature?
|
| Sign In·View Thread·PermaLink | 5.00/5 |
|
|
|
 |
|
 |
Do you know of any code like this in C or C++ internal to windows? By that I mean without 3rd party utils.
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |
|
 |
Hi,
The following bit of code can read the decoded binary data out from the xml node(m_pCurrentNode), so write would be similar(I suppose).. // set the data type to base64 for the node so that automatic decoding // can take place. CString strDataType = "bin.base64"; BSTR bstrDataType =strDataType.AllocSysString(); m_pCurrentNode->put_dataType(bstrDataType); SysFreeString(bstrDataType);
VARIANT vtype; vtype.vt = VT_ARRAY;
m_pCurrentNode->get_nodeTypedValue(&vtype);
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |