Help with Dynamic Graphics in ASp.net

  • Thread starter Thread starter Mahmoud Mousa
  • Start date Start date
M

Mahmoud Mousa

Hi...
Some how I'm facing trouble Saving A Bitmap(I Dynamiclly creat in my
Page) Co's Every Time to Started to save the Image..
The Only thing that Appears in my Page is the Image Alone
And If I tried to asdd any Control Around it Nothing appears

bitmap.save(Response.OutputStream,ImageFormat.Gif);
Response.Write("Hello World");

if I done the Above code He Displays only the Image without The the
"Hello World"

Can Any Body Help me with an Example The Could Help me in this

and thanks
Alot
 
You cannot write an image directly to an HTML page. You
can only put links to images in a page.
Normally your img tag would point to a jpg or a gif image file.
In your case you'll want it to point to a special page you've designed
specifically for outputting these images.
For example:
<img src='myimage.aspx' ...>
 
Thanks Alot About your Reply But this Could not Help Because:the
Response.OutputStream Directly Send the Image to The Client Browser so
no Matter what I Done Beneath the Code Will not Work

like:


bitmap.Save(Response.OutputStream,imageFormat.Gif);
Server.Redirect("myImage.html);

the Second line of Code Will not work Co's After it Finishs its task
send it Directly to the Client Browser But I want the Image I Create to
appear in a Tamblate Page and Here is

My Problems

I want the Image to Be Saved to a Known location in my Server so I can
Add it to my Html Page as

<img src"imagecreat.aspx">

2nd I don't know How to save the Image to the Server after I creat it
that's All


And By the Way I read about Some kind of a tage Called (Replace) But I
still Don't know How to use it May you Could help me
and Thanks Alot

Yours
Mahmoud Mousa
+20 (10) 1800939
 
What we did was put an iframe in the page where the dynamic gif image is to
be shown. Then call a page which does Response.BinaryWrite of the gif image.
Then call this page in the iframe with js or otherwise and problem is
solved. There could be more elegant ways of positioning this image among
html elements. I have yet to know of it.
 
Pls look at an earlier post

Normally your img tag would point to a jpg or a gif image file.
In your case you'll want it to point to a special page you've designed
specifically for outputting these images.
For example:
<img src='myimage.aspx' ...>

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com



Ivan Demkovitch said:
Hi!

I'm using output stream to output image to webpage.

//Move array to response stream.
Response.ContentType = "image/jpeg";
Response.OutputStream.Write(arrBt, 0, arrBt.Length);
Response.End();


But sometime's I want to output link to image instead of byte array.
How do I do this????

ex. //Just pass file name to response...
Response.ContentType = "text/html";
Response.OutputStream.Write((byte[])ScaledImageWebPath, 0,
(int)ScaledImageWebPath.Length);
Response.End();

(example above is not working - cannot convert string to array)
 
Back
Top