Once upon a time, in a blog post far far away, we looked at a very early incarnation of the version 10 Image API which described how images were used with OpenInsight forms and controls. Since then the API has changed quite a bit, so this post gives you a PDF link to a preview of the API documentation which covers the capabilities in the next release, some of which hasn’t been described before.
An overview of the Image API
Many GUI types managed by the Presentation Server support images in one form or another; some have background images, some have glyphs, some have image lists and so on. However, many of these images have properties of their own, and in most cases these image properties are common to all.
Because of this most Presentation Server types that support images expose them as intrinsic “sub-objects”, thorough a model we refer to as the “Image Object API”. The image object’s lifetime is managed by the system and it cannot be programmatically destroyed from Basic+, but it can be manipulated by the Get/Set_Property and Exec_Method functions just like any other Presentation Server object.
The entire Image API is described in the linked PDF below but be aware that not all image objects support all of the API. For example, a PUSHBUTTON type does not support an “INDEX” property for its background image, and its SplitGlyph image doesn’t support an ALIGN property: All such exceptions are documented in the relevant sections that describe each object type.
Supported image types
The Presentation Server supports the following image types via the WIC (Windows Imaging Component) sub-sytem:
Image Object Properties
|ALIGN||Specifies the horizontal and vertical alignment of the image|
within its parent.
|AUTOSCALE||Specifies if the image should be scaled along with its parent|
|COLORKEY||Specifies the color in the image that should be treated as the|
|COUNT||Specifies the number of sub-images within an image file.|
|FILENAME||Returns the name of the image file being displayed.|
|FILENAMES||Specifies an array of DPI-specific image files to display.|
|FRAMECOUNT||Returns the number of “frames” within an image.|
|FRAMEDELAY||Returns the delay time in milliseconds for a multi-frame image.|
|FRAMEINDEX||Specifies the frame to display within a multi-frame image.|
|INDEX||Specifies the index of the sub-image to display within a multiimage file.|
|OFFSET||Specifies the point within the image (not the object) to begin|
|ORIGIN||Specifies the point within the object (not the image) to begin|
|SIZE||Returns the width and height of the image in pixels|
|STYLE||Specifies how the image is drawn into an object (Tiled,|
Stretched, Clipped or Scaled).
|TRANSLUCENCY||Specifies the degree of transparency applied to an image when|
it is drawn
Image Object Methods
|SAVETOFILE||Saves the current image to a file.|
|SETHBITMAP||Loads an image from a Windows BITMAP handle (HBITMAP).|
|SETIMAGE||Loads an image from an array of “raw” image bytes.|
|SETREPOSIMAGE||Specifies the image file(s) using an OpenInsight repository|
Here’s the link to the Image Object API PDF – adding animated GIFs to your applications has never been so easy!