[VBScript]
Set bg = Server.CreateObject("ImageGlue7.Canvas")
Set stamp = Server.CreateObject("ImageGlue7.Canvas")
Set mask = Server.CreateObject("ImageGlue7.Canvas")
' create canvas
bg.Color = "blue"
bg.Width = 100
bg.Height = 90
mask.DrawFile Server.MapPath("cloud.gif"), ""
stamp.Width = mask.Width
stamp.Height = mask.Height
' first draw white cloud
stamp.Color = "white"
stamp.Erase
stamp.SetChannel "alpha", mask.Image
bg.DrawCanvas stamp.Image, "Pos=10,10 Mode=Transparent"
' ... then light gray cloud
stamp.Color = "lightgray"
stamp.Erase
stamp.SetChannel "alpha", mask.Image
bg.DrawCanvas stamp.Image, "Pos=60,10 Mode=Transparent"
' ... then dark gray cloud
stamp.Color = "darkgray"
stamp.Erase
stamp.SetChannel "alpha", mask.Image
bg.DrawCanvas stamp.Image, "Pos=10,60 Mode=Transparent"
' ... then black cloud
stamp.Color = "black"
stamp.Erase
stamp.SetChannel "alpha", mask.Image
bg.DrawCanvas stamp.Image, "Pos=60,60 Mode=Transparent"
' finally save image
bg.SaveAs Server.MapPath("setchannel.jpg"), "Quality=high"
The above draws four solid blocks of color using an alpha
channel as a matte. The input and output files are shown below.
cloud.gif
setchannel.jpg
|
|
|