[VBScript]
Set ca = Server.CreateObject("ImageGlue7.Canvas")
ca.Width = 200
ca.Height = 200
myparams = " Size=100,100 Operation=both"
ca.DrawShape "rect", "Pos=0,0 PaintColor=red PenColor=red" &
myparams
ca.DrawShape "rect", "Pos=100,0 PaintColor=green PenColor=green"
& myparams
ca.DrawShape "rect", "Pos=0,100 PaintColor=blue PenColor=blue"
& myparams
ca.DrawShape "rect", "Pos=100,100 PaintColor=yellow
PenColor=yellow" & myparams
ca.SaveAs Server.MapPath("getcolor.gif"), ""
Response.Write("Top Left Color is " & ca.GetColor("50,50")
& "<br>" & vbCrLf)
Response.Write("Top Right Color is " & ca.GetColor("150,50")
& "<br>" & vbCrLf)
Response.Write("Bottom Left Color is " & ca.GetColor("50,150")
& "<br>" & vbCrLf)
Response.Write("Bottom Left Color is " & ca.GetColor("150,150")
& "<br>" & vbCrLf)
The graphics file and text output that this produces is shown
below. Note that the names of colors map onto what might be
described as a typical value rather than a 100% saturated value.
For instance green is not a 100% saturated green with no other
components (this looks rather garish) but a rather more typical
green color.
getcolor.gif
Top Left Color is 86.7,3.1,2.4,0.0
Top Right Color is 0.0,39.2,6.7,0.0
Bottom Left Color is 0.0,0.0,83.1,0.0
Bottom Left Color is 98.8,95.3,2.0,0.0
|
|
|