I each time get errors when I use an .bmp or ,.gif file as source but
whenever I use a .jpg file it works perfect.
Why is that? and how to fix it?
I almost have no knowledge about the system.drawing and so I am in the dark
about this.
This is my code
----------------------------------
<%@ Page Language="vb" %>
<%@ import namespace="syst em.drawing" %>
<%@ import namespace="syst em.drawing.imag ing" %>
<%@ import namespace="syst em.drawing.draw ing2d" %>
<%
' initialise objects
dim strFilename as string
dim b as New System.Drawing. Bitmap(server.m appath("test.jp g"))
dim g as graphics = graphics.fromim age(b)
g.smoothingMode = smoothingMode.a ntiAlias
dim stringFormat As New StringFormat()
g.drawString("T he Magic Word", New font("arial",3) ,systembrushes. windowtext,
New pointF(2,2), stringFormat)
' Set the content type
response.conten ttype="image/jpeg"
' send the image to the viewer
b.save(response .outputstream, b.rawformat)
' tidy up
b.dispose()
%>