Hi,
Make sure the Base64 string represents a valid image.
"hb" <ho****@goodoffices.com> wrote in message
news:e4**************@TK2MSFTNGP11.phx.gbl...
Hi, Shiva,
Thank you for the help!
I tried the code mentioned in the link page you gave me. But I got the
following error:
===
System.ArgumentException: Invalid parameter used. at
System.Drawing.Image.FromStream(Stream stream, Boolean
useEmbeddedColorManagement, Boolean validateImageData) at
System.Drawing.Image.FromStream(Stream stream, Boolean
useEmbeddedColorManagement) at System.Drawing.Image.FromStream(Stream
stream)
===
Here is the code I used:
---
string sLabel=UPS.UPSShipLabelHtml(); //get Base 64 encoded image string
string sTrackNum=UPS.UPSTrackNum();
if(sLabel.Trim().Length>0)
{
string sf="label"+sTrackNum+".gif";
Byte[] bitmapData=new Byte[sLabel.Length];
//take out space and "\r\n" from sLabel
bitmapData=Convert.FromBase64String(UPS.CleanBase6 4Image(sLabel));
System.IO.MemoryStream memStream=new System.IO.MemoryStream(bitmapData);
System.Drawing.Bitmap bitImage=new
System.Drawing.Bitmap((System.Drawing.Bitmap)Syste m.Drawing.Image.FromStream
(memStream));
bitImage.Save(MapPath("/docs/"+sf));
}
---
Would you please help me to figure out the problem?
Thank you
hb
"Shiva" <sh******@online.excite.com> wrote in message
news:up**************@TK2MSFTNGP12.phx.gbl...
See if this helps: http://vsdntips.com/Tips/VS.NET/Csharp/76.aspx