JScript Icon

Log-in or register.

JScript Icon

Icon is an interface wrapper accessible as a property of the Document object that makes the working with icons possible.

Methods and properties

  • array FormatIDs (get) - returns array of image format identifiers
  • int FileType (get/set) - file type of the icon. Can be one of Icon.FTIco, Icon.FTIcns and Icon.FTBin.
  • void InsertImage(object formatID) - add new (empty) image to the icon.
  • void DeleteImage(object formatID) - remove existing image from the icon.
  • Document GetImage(object formatID) - return a Document object for an image in the icon. The document can be used with the RasterImage wrapper to modify the image.
  • object CreateFormatID(int sizeX, int sizeY, int colorDepth) - create new FormatID object:

FormatID object

  • int SizeX (get/set) - width of an image (1-512).
  • int SizeY (get/set) - width of an image (1-512).
  • int ColorDepth (get/set) - color depth: 1, 4, 8, 24 or 32.

Example

// create a 48x48 image and fill it with red color
var icon = Document.Icon;
var formatID = icon.CreateFormatID(48, 48, 32);
icon.InsertImage(formatID);
var image = icon.GetImage(formatID);
DrawTool.SetColor1(1, 0, 0, 1);
DrawTool.RECTANGLE(image, 0, 0, 48, 48);

Recent comments

user icon Anonymous
Vista & Win 7 icons
What about ICL files?