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
8 dim strFilename as string
9 dim b as New System.Drawing.Bitmap(server.mappath("./chris.jpg"))
10
11 dim g as graphics = graphics.fromimage(b)
12
13 g.smoothingMode = smoothingMode.antiAlias
14 g.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
19 dim stringFormat As New StringFormat()
20 stringFormat.FormatFlags = StringFormatFlags.DirectionVertical
21
22 g.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
26 response.contenttype="image/jpeg"
27
28 ' send the image to the viewer
29 b.save(response.outputstream, b.rawformat)
30
31 ' tidy up
32 b.dispose()
33
34 %>
35