# class KAlphaPainter | Methods to easily draw/blend images with an alpha channel. More...
Definition | `#include <kalphapainter.h>`
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Static Methods

- static bool draw (QPainter *p, const QImage &icon, QImage &background, int x, int y, bool copyOnBg=false, int bgx=0, int bgy=0)
- static bool draw (QPainter *p, const QImage &icon, const QPixmap &background, int x, int y, bool copyOnBg=false, int bgx=0, int bgy=0)
- static bool draw (QPainter *p, const QPixmap &icon, QImage &background, int x, int y, bool copyOnBg=false, int bgx=0, int bgy=0)
- static bool draw (QPainter *p, const QPixmap &icon, const QPixmap &background, int x, int y, int bgx=0, int bgy=0)

## Detailed Description

This class includes some static methods to handle easier icons (or images) with an alpha channel.

Everything is static, so there is no need to create an instance of this class. You can just call the static methods. They are encapsulated here merely to provide a common namespace.

bool draw (QPainter *p, const QImage &icon, QImage &background, int x, int y, bool copyOnBg=false, int bgx=0, int bgy=0) | ### draw

[static]

Draws an image ( `icon` ) which has an alpha channel using the painter `p`. `background` is the background image over which the icon is being painted (note that `background` contains the whole picture, and doesn't have to be of the same size than `icon`).

`x` and `y` specify the point on `p` (and on `bg`) over which `icon` will be painted.

If `copyOnBg` is false (the default), the image will be drawn only on the PaintDevice which `p` is using. If `copyOnBg` is true, the icon will also be painted over the `background` image, so that next calls to this method for overlapped icons result in a correct image.

If `relativeBg` is true, the background upperleft corner (background(0,0) point) is x,y, that is, it's not the whole background, but just a portion of it, starting where the icon will be painted. This can be used in applications that don't want to store the whole background if it can become too big.

Returns: true if ok, and false if something went wrong.

bool draw (QPainter *p, const QImage &icon, const QPixmap &background, int x, int y, bool copyOnBg=false, int bgx=0, int bgy=0) | ### draw

[static]

Method provided by convenience which takes the background as a QPixmap object. Note that in this case, copyOnBg is still not implemented.

bool draw (QPainter *p, const QPixmap &icon, QImage &background, int x, int y, bool copyOnBg=false, int bgx=0, int bgy=0) | ### draw

[static]

Method provided by convenience which takes the background as a QPixmap object.

bool draw (QPainter *p, const QPixmap &icon, const QPixmap &background, int x, int y, int bgx=0, int bgy=0) | ### draw

[static]

- Author: Antonio Larrosa <larrosa@kde.org>
- Generated: root@i386.ports.openbsd.org on Wed Apr 25 13:58:24 2001, using kdoc 2.0a53.