Forums
This topic is locked
What did I do WRONG??
21 Jan 2004 17:21:54 D J posted:
<%@ import namespace="System" %> <%@ import namespace="System.Drawing" %>
<%@ import namespace="System.Drawing.Imaging" %>
<%@ import namespace="System.IO" %>
<script language="vb" runat="server">
Sub sendFile()
dim Pl as System.Drawing.Image = System.Drawing.Image.FromFile(server.mappath(request("/david_07/"))
dim thisFormat=Pl.rawformat
dim imgOutput as New Bitmap(Pl, cint(request("width"), cint(request("height"))
if thisformat.equals(system.drawing.imaging.imageformat.Gif) then
response.contenttype="image/Gif"
else
response.contenttype="image/jpeg"
end if
imgOutput.save(response.outputstream, thisformat)
Pl.dispose()
imgOutput.dispose()
end sub
Sub sendError()
dim imgOutput as New bitmap(150, 150, pixelformat.format24bpprgb)
dim Pl as graphics = graphics.fromimage(imgOutput)
Pl.clear(color.red)
Pl.drawString("WARNING!!", New font("Times New Roman",16,fontstyle.bold),systembrushes.windowtext, New pointF(2,0))
response.contenttype="image/gif"
imgOutput.save(response.outputstream, imageformat.Gif)
Pl.dispose()
imgOutput.dispose()
end sub
</script>
<%response.clear
if request("/david_07/"="" or request("height"="" or request("width"="" then
call sendError()
else
if file.exists(server.mappath(request("/david_07/")) then
call sendFile()
else
call sendError()
end if
end if
response.end %>
Is there anybody that can help??
Replies
Replied 21 Jan 2004 19:47:40
21 Jan 2004 19:47:40 Dave Thomas replied:
it would help if you told us what the problem was, and what the script is intended to do.
Regards,
Dave
[DWMX 2004] | [FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]
Regards,
Dave
[DWMX 2004] | [FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]
Replied 22 Jan 2004 09:33:53
22 Jan 2004 09:33:53 D J replied:
It should load a thumbnail into a page but it doesn't. I can't find what I did wrong. Maybe there is a other solution.
Replied 23 Jan 2004 12:38:44
23 Jan 2004 12:38:44 D J replied:
Thanks For your help but I already got it done may be you can help next time!!