This example shows how to perform an Unsharp Mask effect on two images held in ImageGlue Canvases.


Create two Canvases

To start with you need two ImageGlue Canvas. We'll create them and put a picture of a boat into one and a picture of some birds into the other.

thePath = Server.MapPath("images/boat.jpg")
Set theCanv1 = Server.CreateObject("ImageGlue5.Canvas")
theCanv1.DrawFile thePath, ""

thePath = Server.MapPath("images/birds.jpg")
Set theCanv2 = Server.CreateObject("ImageGlue5.Canvas")
theCanv2.DrawFile thePath, ""

Apply the Effect

Next we apply the effect to the images. Note that we only need to change the radius setting once. It will retain its value until the top level FX object is deleted or until the Reset method is called.

Set theFX = Server.CreateObject("ImageEffects.FX")
Set theEffect = theFX(
"Unsharp Mask")
theEffect("Radius") = 3
theEffect.Image = theCanv1.Image
theEffect.Image = theCanv2.Image


Save the Images

Finally we save the sharpened images.

thePath = Server.MapPath("images/sharpboat.jpg")
theCanv1.SaveAs thePath, ""

thePath = Server.MapPath("images/sharpbirds.jpg")
theCanv2.SaveAs thePath, ""