Return Existing Graphic

  • Thread starter Thread starter Jonathan Wood
  • Start date Start date
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
 
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
 
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
 
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
 
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)
 
Back
Top