D
Dave Keen
Hi all.
Hope you can help me. This should be easy but I can't make this work.
In brief I am building a page of thumbnails using images held in a
SQLServer 2000 database. I do this by creating imagebuttons which
point to a dummy page that takes the image and displays it via
response. All works fine if I use explicit paths to a file
(response.writefile(<filename>) or directly pass through the database
image (response.binarywrite(<dbimage>), but I convert the db image to
system.drawing.image so as to resize etc, and once I do that I can't
display it.
I have used the following code to take the database image, convert it
into a system.drawing.image and show the results (this is obviously a
cut down version of the original).
Dim clsTableImage As New TableImage
If clsTableImage.GetRecord(CType(1, Short)) = 0 Then
' Make an image object of the image using a stream
Dim FullSizeImage As System.Drawing.Image
Dim fs As New System.IO.MemoryStream
Dim w As New System.IO.BinaryWriter(fs)
w.Write(clsTableImage.Image)
FullSizeImage = System.Drawing.Image.FromStream(fs)
'Response.ContentType = "image/jpeg"
Response.Write(FullSizeImage)
End If
clsTableImage is a class that returns the image as a byte array. What
I get out of this is the text "system.drawing.bitmap". So, how do I
send a system.drawing.image to the form in ASP 1.1?
Thanks in advance.
Dave
Hope you can help me. This should be easy but I can't make this work.
In brief I am building a page of thumbnails using images held in a
SQLServer 2000 database. I do this by creating imagebuttons which
point to a dummy page that takes the image and displays it via
response. All works fine if I use explicit paths to a file
(response.writefile(<filename>) or directly pass through the database
image (response.binarywrite(<dbimage>), but I convert the db image to
system.drawing.image so as to resize etc, and once I do that I can't
display it.
I have used the following code to take the database image, convert it
into a system.drawing.image and show the results (this is obviously a
cut down version of the original).
Dim clsTableImage As New TableImage
If clsTableImage.GetRecord(CType(1, Short)) = 0 Then
' Make an image object of the image using a stream
Dim FullSizeImage As System.Drawing.Image
Dim fs As New System.IO.MemoryStream
Dim w As New System.IO.BinaryWriter(fs)
w.Write(clsTableImage.Image)
FullSizeImage = System.Drawing.Image.FromStream(fs)
'Response.ContentType = "image/jpeg"
Response.Write(FullSizeImage)
End If
clsTableImage is a class that returns the image as a byte array. What
I get out of this is the text "system.drawing.bitmap". So, how do I
send a system.drawing.image to the form in ASP 1.1?
Thanks in advance.
Dave