Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   Displaying an image file that is not in the web directory (http://www.velocityreviews.com/forums/t772772-displaying-an-image-file-that-is-not-in-the-web-directory.html)

Javier 02-26-2004 10:06 PM

Displaying an image file that is not in the web directory
 
Hi all

does anyone know of a way to display an image that is not in the web directory, as a part of a page

Javier

vMike 02-27-2004 06:39 PM

Re: Displaying an image file that is not in the web directory
 
You can set the img src tag to an aspx file ... say
getpic.aspx?_p=yourpicname ... and use something like this snip (not
tested).

Sub Page_Load(sender as object, e as eventArgs)
Response.ContentType = "image/jpeg"
dim strPics as string = Request.QueryString.Item("_p")
mgGenerateImage(strPics)
End Sub


Sub mgGenerateImage(strPics as string)
dim strNavPath as string = "c:\yournonwebpath\" 'probably want to store
setting in webconfig
dim myNewImage as system.drawing.image
try
myNewImage = New Bitmap(strNavPath & "strPics" & ".jpg")
mynewimage.Save(Response.OutputStream, ImageFormat.Jpeg)

catch
myNewImage = New Bitmap(strNavPath & "yourdefaultimage.jpg")
mynewimage.Save(Response.OutputStream, ImageFormat.Jpeg)

end try
mynewimage.dispose()
End Sub

You will need System.Drawing and System.Drawing.Imaging namespaces

"Javier" <hgalindo@engineer.com> wrote in message
news:CB51B496-A2A0-4552-AD79-FCBDE869C945@microsoft.com...
> Hi all,
>
> does anyone know of a way to display an image that is not in the web

directory, as a part of a page?
>
> Javier





All times are GMT. The time now is 01:49 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.