class PImgIcon: public PContainer

A class representing an image icon.

Inheritance:


Public Methods

[more] PImgIcon ()
Create image icons.
[more] PImgIcon ( PCanvas & canvas, const PPixelImage & pix )
Create an image icon from the arbitrary pixel image using the canvas as the target device.
[more]virtual Comparison Compare ( const PObject & obj ) const
Determine if the two icons are the same.
[more]virtual PDim GetDimensions () const
Get the dimensions of the image.

Public

[more] Overrides from class PObject
[more] New functions for class


Inherited from PContainer:

Public

Construction

Common functions for containers

Protected Methods

ovirtual void DestroyContents()
ovirtual void AssignContents(const PContainer & c)
ovoid CopyContents(const PContainer & c)
ovoid CloneContents(const PContainer * src)
ovoid Destruct()


Inherited from PObject:

Public

Run Time Type functions

Comparison functions

I/O functions

Miscellaneous functions


Documentation

A class representing an image icon. This differs from a PPixelImage class object in its internal representation of the pixels. The PPixelImage is a device and largely platform independent format. The PImgIcon is tied to a particular device (screen, printer etc) and platform.

Generally, a PImgIcon is faster to draw but may consume limited resources. There is also less flexibility for image processing as the image pixels are not available to be modified.

For example, for X-Windows a PPixelImage is a client resource and every time it needs to be drawn the pixel data must be transfered to the X server. A PImgIcon is an X server resource and does not need this transfer so is much faster. However, as X server memory may be limited, this may not be used with impunity.

This class is typically used for small user interface images such as icons within image push buttons in a tool bar. For this purpose the images are usually created via a resource.

There is no intrinsic requirement that the image be small or drawn to the device it was created for. However, not doing this can have unexpected results, especially in colours and scaling.

o PImgIcon()
Create image icons. If no resource is specified then an empty image is created. With these contructors the screen is assumed to be the device that the image is to be drawn to.

o PImgIcon( PCanvas & canvas, const PPixelImage & pix )
Create an image icon from the arbitrary pixel image using the canvas as the target device.
Parameters:
canvas - Canvas for the device dependent image.
pix - Device independent image to convert.

o Overrides from class PObject

ovirtual Comparison Compare( const PObject & obj ) const
Determine if the two icons are the same. Note that this is different from having two icons that merely look the same. They must be references to the same icon or if loaded from resources, the same resource ID.

Returns:
EqualTo if reference the same icon, GreaterThan if different.
Parameters:
obj - Image icon to compare against.

o New functions for class

ovirtual PDim GetDimensions() const
Get the dimensions of the image.

Returns:
width and height of image icon.


Direct child classes:
PIcon

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.