Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > write response.outputstream into a control

Reply
Thread Tools

write response.outputstream into a control

 
 
Victor
Guest
Posts: n/a
 
      05-08-2007
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



 
Reply With Quote
 
 
 
 
robert112
Guest
Posts: n/a
 
      05-08-2007
On May 8, 12:19 pm, "Victor" <(E-Mail Removed)> wrote:
> 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"><aspanel id="foo" runat="server"></panel></div>
</html>

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


 
Reply With Quote
 
 
 
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      05-08-2007
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 ((E-Mail Removed), 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.

 
Reply With Quote
 
Victor
Guest
Posts: n/a
 
      05-09-2007
OhOh, that works
thanks a lot Walter~~~
"Walter Wang [MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 ((E-Mail Removed), 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.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get a custom Control Designer to write to the HTML of my control? Don ASP .Net Building Controls 1 07-18-2005 11:16 PM
Re: It seems that ZipFile().write() can only write files,how can empty directories be put into it? could ildg Python 0 07-02-2005 08:31 AM
Re: It seems that ZipFile().write() can only write files,how can empty directories be put into it? Jeff Epler Python 0 07-01-2005 02:06 PM
It seems that ZipFile().write() can only write files,how can empty directories be put into it? could ildg Python 0 07-01-2005 01:50 AM
how to write some xml into huge xml file into speceific location??? Xenia XML 4 11-25-2003 07:14 PM



Advertisments