Show Image on webpage
-
Hey all, In my backend (code), i've got a Bitmap, which I've filled with some pixels. Now I want to show this image on an aspx page. Does anyone has any idea how to solve this problem. I've tried , but this needs an url. I Also tried but this also needs an url.
-
Hey all, In my backend (code), i've got a Bitmap, which I've filled with some pixels. Now I want to show this image on an aspx page. Does anyone has any idea how to solve this problem. I've tried , but this needs an url. I Also tried but this also needs an url.
Img tags are the only way to show images over an HTML. Img requires an url directly to the image. so you have to store the bitmap to your virtual dir and then get the image. There is no other way of doing this. :rose::rose:
Abhishek Sur My Latest Articles Basics on LINQ and Lambda Expressions
Create .NET Templates -
Hey all, In my backend (code), i've got a Bitmap, which I've filled with some pixels. Now I want to show this image on an aspx page. Does anyone has any idea how to solve this problem. I've tried , but this needs an url. I Also tried but this also needs an url.
Save the Image then you can create tag from the code.
Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
-
Img tags are the only way to show images over an HTML. Img requires an url directly to the image. so you have to store the bitmap to your virtual dir and then get the image. There is no other way of doing this. :rose::rose:
Abhishek Sur My Latest Articles Basics on LINQ and Lambda Expressions
Create .NET TemplatesThank you for your response. Though the anwser has been given to me by my colegue. It's like this: backend page 1:
Image1.ImageUrl = "GetImage.aspx?id="
backend page 'getImage.aspx':
int number = int.Parse(Page.Request.QueryString.Get("id"));
Bitmap b = makeImageByNumber(number);
//Set the Responsetype Response.ContentType = "image/jpeg"; //Save the dynamicly generated bitmap to the OutpuStream b.Save(Response.OutputStream, ImageFormat.Jpeg); //End we're done. Response.End();
-
Thank you for your response. Though the anwser has been given to me by my colegue. It's like this: backend page 1:
Image1.ImageUrl = "GetImage.aspx?id="
backend page 'getImage.aspx':
int number = int.Parse(Page.Request.QueryString.Get("id"));
Bitmap b = makeImageByNumber(number);
//Set the Responsetype Response.ContentType = "image/jpeg"; //Save the dynamicly generated bitmap to the OutpuStream b.Save(Response.OutputStream, ImageFormat.Jpeg); //End we're done. Response.End();
That means you are directly writing the image stream to the response. it is same as making writing a static link. If you want to do this, why not u use a special handler for the response. Like ImageResource.axd which corresponds to an handler which will produce images. Even Microsoft does take this steps for writing javascript files to the client. :rose:
Abhishek Sur My Latest Articles Basics on LINQ and Lambda Expressions
Create .NET Templates