Response.BinaryWrite
Hello all,
I am querying an image file from a SQL database and using Response.BinaryWrite to write the image to a browser. The image is stored at 640X480 and I would like to be able to resize this image to display something a little smaller in the browser. Is there a way that this can be done and how?
My current code:
strIMG = "2400" & Replace(Request.Querystring("image"), "'", "''")
Set objComm = Server.CreateObject("ADODB.Command")
objComm.ActiveConnection = strConnect
objComm.CommandText = "SELECT image FROM v_image WHERE image_id = '" & strIMG & "'"
objComm.CommandType = adCmdText
Set objRS = objComm.Execute
Set objComm = Nothing
If objRS.EOF Then
Response.Write "Nothing Found " & strIMG
Else
Response.BinaryWrite objRS("image")
End If
objRS.Close
Set objRS = Nothing
This displays fine with the exception of not being able to alter the image size.
Thanks in advance.
|