|
[Visual Basic]
Dim ca As New Canvas
Dim inpath, outpath As String
inpath = Server.MapPath("rez/layers.psd")
outpath = Server.MapPath("drawshape.jpg")
ca.PaintColor = System.Drawing.Color.Blue
ca.PenSize = 4
ca.Width = 250
ca.Height = 250
ca.DrawShape("oval", "Pos=10,10 Size=100,100 Operation=both")
ca.DrawShape("line", "Points=120,120,200,170,130,200
Operation=draw OpenGL=true")
ca.DrawShape("roundrect", "Pos=20,120 Size=80,80
Operation=draw OpenGL=true")
ca.DrawShape("poly", "Points=120,20,200,40,120,100
Operation=draw")
ca.DrawShape("oval", "Pos=0,0 Size=250,250 Operation=draw
OpenGL=true")
ca.DrawShape("rect", "Pos=0,0 Size=250,250 Operation=draw")
ca.SaveAs(outpath, "Quality=high")
[C#]
Canvas ca = new Canvas();
string inpath = Server.MapPath("rez/layers.psd");
string outpath = Server.MapPath("drawshape.jpg");
ca.PaintColor = System.Drawing.Color.Blue;
ca.PenSize = 4;
ca.Width = 250;
ca.Height = 250;
ca.DrawShape("oval", "Pos=10,10 Size=100,100 Operation=both");
ca.DrawShape("line", "Points=120,120,200,170,130,200
Operation=draw OpenGL=true");
ca.DrawShape("roundrect", "Pos=20,120 Size=80,80
Operation=draw OpenGL=true");
ca.DrawShape("poly", "Points=120,20,200,40,120,100
Operation=draw");
ca.DrawShape("oval", "Pos=0,0 Size=250,250 Operation=draw
OpenGL=true");
ca.DrawShape("rect", "Pos=0,0 Size=250,250 Operation=draw");
ca.SaveAs(outpath, "Quality=high");
The code draws a number of shapes using a number of different options.
Note that the top two shapes are drawn without OpenGL and the bottom
two with it.
drawshapes.jpg
|
|
|