Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXIcon Class Reference

An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask those pixels where the background should be preserved during the drawing, and a etch bitmap, which is used to draw the icon when it is disabled. More...

#include <FXIcon.h>

Inheritance diagram for FX::FXIcon:

FX::FXImage FX::FXDrawable FX::FXId FX::FXObject FX::FXBMPIcon FX::FXGIFIcon FX::FXICOIcon FX::FXIFFIcon FX::FXJPGIcon FX::FXPCXIcon FX::FXPNGIcon FX::FXPPMIcon FX::FXRASIcon FX::FXRGBIcon FX::FXTGAIcon FX::FXTIFIcon FX::FXXBMIcon FX::FXXPMIcon List of all members.

Public Member Functions

 FXIcon (FXApp *a, const FXColor *pix=NULL, FXColor clr=0, FXuint opts=0, FXint w=1, FXint h=1)
virtual void create ()
virtual void detach ()
virtual void destroy ()
virtual void render ()
virtual void resize (FXint w, FXint h)
FXColor getTransparentColor () const
void setTransparentColor (FXColor color)
virtual ~FXIcon ()

Friends

class FXDC
class FXWindow
class FXDCWindow
class FXDrawable
class FXTopWindow

Detailed Description

An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask those pixels where the background should be preserved during the drawing, and a etch bitmap, which is used to draw the icon when it is disabled.


Constructor & Destructor Documentation

FX::FXIcon::FXIcon FXApp a,
const FXColor pix = NULL,
FXColor  clr = 0,
FXuint  opts = 0,
FXint  w = 1,
FXint  h = 1
 

Create an icon with an initial pixel buffer pix, a transparent color clr, and options as in FXImage.

The transparent color is used to determine which pixel values are transparent, i.e. need to be masked out in the absence of a true alpha channel. If the flag IMAGE_OPAQUE is passed, the shape and etch bitmaps are generated as if the image is fully opaque, even if it has an alpha channel or transparancy color. The flag IMAGE_ALPHACOLOR is used to force a specific alpha color instead of the alpha channel obtained from the image file. Specifying IMAGE_ALPHAGUESS causes Icon to obtain the alpha color from the background color of the image; it has the same effect as IMAGE_ALPHACOLOR in the sense that the icon will be transparent for those colors matching the alpha color.

virtual FX::FXIcon::~FXIcon  )  [virtual]
 

Destructor.


Member Function Documentation

virtual void FX::FXIcon::create  )  [virtual]
 

Create the server side pixmap, the shape bitmap, and the etch bitmap, then call render() to fill it with the pixel data from the client-side buffer.

After the server-side pixmap and bitmaps have been created, the client-side pixel buffer will be deleted unless IMAGE_KEEP has been specified. If the pixel buffer is not owned, i.e. the flag IMAGE_OWNED is not set, the pixel buffer will not be deleted; however the pixel buffer will be set to NULL.

Reimplemented from FX::FXImage.

virtual void FX::FXIcon::detach  )  [virtual]
 

Detach the server side pixmap, shape bitmap, and etch bitmap from the Icon.

Afterwards, the Icon is left as if it never had a server-side resources.

Reimplemented from FX::FXImage.

virtual void FX::FXIcon::destroy  )  [virtual]
 

Destroy the server-side pixmap and the shape bitmap and etch bitmap.

The client-side pixel buffer is not affected.

Reimplemented from FX::FXImage.

virtual void FX::FXIcon::render  )  [virtual]
 

Render the server-side pixmap, shape bitmap and etch bitmap for the icon from the client-side pixel buffer.

Reimplemented from FX::FXImage.

virtual void FX::FXIcon::resize FXint  w,
FXint  h
[virtual]
 

Resize both client-side and server-side representations (if any) to the given width and height.

The new representations typically contain garbage after this operation and need to be re-filled.

Reimplemented from FX::FXImage.

FXColor FX::FXIcon::getTransparentColor  )  const [inline]
 

Obtain transparency color.

void FX::FXIcon::setTransparentColor FXColor  color  )  [inline]
 

Change transparency color.


Friends And Related Function Documentation

friend class FXDC [friend]
 

Reimplemented from FX::FXImage.

friend class FXWindow [friend]
 

friend class FXDCWindow [friend]
 

Reimplemented from FX::FXImage.

friend class FXDrawable [friend]
 

friend class FXTopWindow [friend]
 

Copyright © 1997-2005 Jeroen van der Zijp