Returns information about the image on the canvas.



theInfo = Canvas.GetInfo(inType)


Name   Type   Description
inType String The type of information - "SelectionRect" or "Palette".
theInfo Variant or Object The returned information.



This method allows access to a variety of information about a canvas. Currently the method supports two selectors.

  • "SelectionRect"
  • "Palette"

The SelectionRect selector returns the bounds of the current selection. The selection is the portion of the image that is visible using the image opacity held in the alpha channel. The return value is a string containing a rectangle (e.g. "10,10,40,40").

The Palette selector returns a raw palette for the image. This can be saved as a file - generally with the extension 'act' - or used in other calls such as those to ReduceColors. The return value is a raw array of bytes. You can only obtain palettes for canvases with 256 or fewer colors.

See Also




Set ca = Server.CreateObject("ImageGlue7.Canvas")

ca.DrawFile Server.MapPath("main.jpg"), ""
ca.ReduceColors "adaptive", 8, True
ca.SaveAs Server.MapPath("main.gif"), ""

plt = ca.GetInfo("palette")

ca.DrawFile Server.MapPath("sub.jpg"), ""
ca.ReduceColors plt, 0, True
ca.SaveAs Server.MapPath("sub.gif"), ""

First we draw our main image onto a canvas and reduce the number of colors down to eight. We then save the image as a GIF and extracts the palette from the image using the GetInfo function. To apply the palette to another image we just use the ReduceColors method and pass in the palette we want to use.

The main and sub images are shown below.



The output GIF images are shown below. Notice that both images use the same colors - chosen from the main image.


. sub.gif