Return Existing Graphic

J

Jonathan Wood

I know how to generate an image on the fly. But does anyone have an example
where I return an existing graphic instead of generating it?

I want to return one of several existing graphics images based on the
argument provided.

Thanks.

Jonathan
 
J

Jonathan Wood

I'll probably just store the images as files on the server.

I run some algorithm and want to return one of those images based on the
result of that algorithm.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
http://www.softcircuits.com/blog/

Eliyahu Goldin said:
Where do the images exist? Database, files, something else?

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


Jonathan Wood said:
I know how to generate an image on the fly. But does anyone have an
example where I return an existing graphic instead of generating it?

I want to return one of several existing graphics images based on the
argument provided.

Thanks.

Jonathan
 
D

David

If you are using an image handler to handle your images (wether generating
or not), then can't you do something like...

if (File.Exists("pathToImage"))
{
Response.Redirect("pathToImage");
}
else
{
generateimage;
}

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available




Jonathan Wood said:
I'll probably just store the images as files on the server.

I run some algorithm and want to return one of those images based on the
result of that algorithm.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
http://www.softcircuits.com/blog/

Eliyahu Goldin said:
Where do the images exist? Database, files, something else?

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


Jonathan Wood said:
I know how to generate an image on the fly. But does anyone have an
example where I return an existing graphic instead of generating it?

I want to return one of several existing graphics images based on the
argument provided.

Thanks.

Jonathan
 
J

Jonathan Wood

Easy enough. I'll give that a try.

Thanks!

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
http://www.softcircuits.com/blog/

David said:
If you are using an image handler to handle your images (wether generating
or not), then can't you do something like...

if (File.Exists("pathToImage"))
{
Response.Redirect("pathToImage");
}
else
{
generateimage;
}

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available




Jonathan Wood said:
I'll probably just store the images as files on the server.

I run some algorithm and want to return one of those images based on the
result of that algorithm.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
http://www.softcircuits.com/blog/

Eliyahu Goldin said:
Where do the images exist? Database, files, something else?

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


I know how to generate an image on the fly. But does anyone have an
example where I return an existing graphic instead of generating it?

I want to return one of several existing graphics images based on the
argument provided.

Thanks.

Jonathan
 
M

Murtaza Iqbal Gandhi

Eliyahu said:
Where do the images exist? Database, files, something else?
you may try and using the object
of type

System.Drawing.Image

oImg = oImg.FromFile(absolutePath)

and the same image can be displayed to the output screen.

Response.ContentType = "image/jpeg"

oImg.Save (Response.OutputStream, ImageFormat.Jpeg)
 

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
474,145
Messages
2,570,825
Members
47,371
Latest member
Brkaa

Latest Threads

Top