write response.outputstream into a control

V

Victor

Hi Guys
I have a server-side div control inside my aspx page. I also have another
Memory image object (like Bitmap image = new Bitmap(FileName)). The
objective I want to achieve is adding this image object into the div
control. I tried to use Bitmap.save(Stream stream, ImageFormat format)
method. But I found out if I did so, it will overwrite my rest of page.
Insteading of displaying the page properly, It only displays one image.
Can anyone help me on this? Is this possible to write outputstream into one
control?

cheers
Victor
 
R

robert112

Hi Guys
I have a server-side div control inside my aspx page. I also have another
Memory image object (like Bitmap image = new Bitmap(FileName)). The
objective I want to achieve is adding this image object into the div
control. I tried to use Bitmap.save(Stream stream, ImageFormat format)
method. But I found out if I did so, it will overwrite my rest of page.
Insteading of displaying the page properly, It only displays one image.
Can anyone help me on this? Is this possible to write outputstream into one
control?

cheers
Victor

I'm not sure I understand correctly but try wrapping that div in a
panel and add the image object to the panel.

so something like
<html>
<div id="SomeDiv"><asp:panel id="foo" runat="server"></panel></div>
</html>

then in the code behind: foo.add(imageObject)
 
W

Walter Wang [MSFT]

Hi Victor,

Yes by writing out to the Response stream using the binary image data, the
response at client-side will be the image only.

To embed an image in some other element, you will need an <img> tag at
client-side. You can use an server control <asp:Image> inside your div tag.
You will need another webform to generate the image using Bitmap and
Response stream. Then you can point the Image control's ImageUrl property
to this webform:

<div>
<asp:Image runat="server" ID="image1"
ImageUrl="GetImage.aspx?name=foo" />
</div>


In the GetImage.aspx, you can check the QueryString and use different image
file accordingly.

Hope this helps.

Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top