Class XbpIcon() Foundation

Class function of the XbpIcon class.

Description

The XbpIcon class provides objects which can display and manage graphic images defined in icon files. Icon files must be linked to the EXE file using the resource compiler in order for the icon to be loaded using the :load() method of the XbpIcon object.

Class methods
:new()
Creates an instance of the XbpIcon class.
:create()
Requests system resources for the XbpIcon object.
:configure()
Reconfigures the XbpIcon object after :create() has been executed.
:destroy()
Releases the system resources of the XbpIcon object.
Runtime data
:bits
The number of bits per color.
:planes
Number of bit planes per pixel.
:xSize
The number of pixels in x direction (width).
:ySize
The number of pixels in y direction (height).
Manipulation
:draw()
Displays an icon.
:load()
Loads an icon from a resource file linked to the executable file.
:loadFile()
Loads an icon file from disk
:saveFile()
Saves an icon in a file.
:getIPicture()
Returns the icon as an IPicture automation object.
:getBitmap()
Returns the icon image as an XbpBitmap object.
:setIPicture()
Initializes the icon through an IPicture automation object.
Examples
Declare, load and display an icon as a resource

// This example demonstrates the basic process of creating 
// icons and displaying them in a window. The icon is 
// loaded and displayed using the resource ID 10. At the 
// end of the example code, an example of a resource file 
// containing the icon as a resource is shown. 
PROCEDURE Main 
   LOCAL oIcon, oPS 

   SetColor( "N/W" ) 
   CLS 

   oPS := SetAppWindow():presSpace() 
   oIcon:= XbpIcon():new():create() 

   oIcon:load( NIL, 10 ) 
   oIcon:draw( oPS, {50,50} ) 

   WAIT 

RETURN 

/* Resource file containing the icon declaration 
   TEST.ARC 
*/ 
   ICON     1     =  "XPPPMT.ICO" 
   POINTER  2     =  "XPPPOINT.PTR" 

   ICON     10    =  "DATABASE.ICO" 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.