|
[Visual Basic]
Dim ca As New Canvas
Dim ptn As New Canvas
Dim pts As String
ptn.DrawFile(Server.MapPath("rez/boat.gif"), "")
pts = "Points = 30,190,100,10,170,190,10,70,190,70"
ca.Color = System.Drawing.Color.Yellow
ca.Width = 200
ca.Height = 200
ca.Pattern = ptn.Image
ca.DrawShape("poly", pts)
ca.SaveAs(Server.MapPath("pattern.jpg"), "")
[C#]
Canvas ca = new Canvas();
Canvas ptn = new Canvas();
ptn.DrawFile(Server.MapPath("rez/boat.gif"), "");
string pts = "Points = 30,190,100,10,170,190,10,70,190,70";
ca.Color = System.Drawing.Color.Yellow;
ca.Width = 200;
ca.Height = 200;
ca.Pattern = ptn.Image;
ca.DrawShape("poly", pts);
ca.SaveAs(Server.MapPath("pattern.jpg"), "");
The page draws a closed polygon in the shape of a star filling
it with a pattern taken from another canvas. It then saves the image
out as a jpeg. The input and output images are shown below.
boat.gif
pattern.jpg
|
|
|