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 said:
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?