The Client wants to see their org charts on the web brower. It has an underlaying image map that will allow the user to drill down to a more isolated view of some part of the organization. Some of the charts got so dense, the information wasnt readable unless they were enlarged, sometimes by a factor of 2-2.5. Its with these large versions things get wacky.
The image is generated serverside, then passed to a Cache object to be accessed by the code behind on the page that displays it.This page is placed in content tags of a master page. When I remove all the asp related stuff from the .aspx I can get the image to show (that is, shows in straight html). Otherwise it shows the image without any width. Its still there, I can highlight part of it, and save it to the desk top, but it does not display.
Here is the code after the image is generated on the server:
try{
// Change the response headers to output a JPEG image.
this.Response.Clear();this.Response.ContentType = "image/jpeg";
System.Drawing.
Image OC = null;
//Build the image string imageName = Request.QueryString["ID"];//take the image from Cacheif (Cache[imageName] != null)
{
MemoryStream ms = new MemoryStream();OC = (System.Drawing.Image)Cache[imageName];//make sure its an image
OC.Save(ms,
ImageFormat.Jpeg);//Save it to the memory stream
byte[] imgBytes = ms.GetBuffer(); //take memory stream and turn it into byte array
ms.Close();
OC.Dispose();
// Write the image to the response stream in JPEG format.
Response.OutputStream.Write(imgBytes, 0, imgBytes.Length); //write to the output stream
Response.Flush();
Response.End();
}
}