vertical.aspx by Chris Garrett
1<%@ Page Language="vb" %>
2<%@ import namespace="system.drawing" %>
3<%@ import namespace="system.drawing.imaging" %>
4<%@ import namespace="system.drawing.drawing2d" %>
5<%
6
7' initialise objects
8dim strFilename as string
9dim b as New System.Drawing.Bitmap(server.mappath("./chris.jpg"))
10
11dim g as graphics = graphics.fromimage(b)
12
13g.smoothingMode = smoothingMode.antiAlias
14g.FillRectangle(New linearGradientBrush(New point(0,0), New point(b.width,b.height), color.fromArgb(255,255,255,255),color.fromArgb(100,100,100,100)),0,0,b.width,b.height)
15
16
17
18
19dim stringFormat As New StringFormat()
20stringFormat.FormatFlags = StringFormatFlags.DirectionVertical
21
22g.drawString(date.now.ToString("t"), New font("arial black",24,fontstyle.italic),systembrushes.windowtext, New pointF(2,2), stringFormat)
23
24
25' Set the content type
26response.contenttype="image/jpeg"
27
28' send the image to the viewer
29b.save(response.outputstream, b.rawformat)
30
31' tidy up
32b.dispose()
33
34%>
35