Display graphic to page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am writting a control that paints an image to a graphic (created from a bmp).
I want to be able to display the painted image directly without having to
save to file and link to the saved image.
I have been told this can now be done in .NET 2.0.
Is this so? How?
 
Brian,

You need to make an aspx page GetImage.aspx that will make the image and
stream it down to the client in the http response .

Eliyahu
 
Eliyahu,

Yep, I did that and the image is created and displayed. However, the image
takes up the whole page. My page has controls on the left for generating the
image properties, and a control on the right to display the image. I need to
be able to generate the image and place it in other pages without saving to
file.

Can I use some sort of user control, placeholder or literal that will hold
the image amongst the other page content?

my code is:

Image img = MyClass.GenerateImage();
Response.ContentType = :image/jpeg";
img.Save(Response.Outputstream, ImageFormat.Jpeg);
img.Dispose();

I have tried this code in a Web UserControl, but still the whole page is
taken up by the image.
 
Brian,

You need to use the url to the image generating page as a regular link to
the image in web or html controls. For example, if you want to get an image
with id 123 and put it into an asp:Image control, you would write

miImage.ImageUrl = 'getImage.aspc?id=123';

Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top