#include <math.h>#include <QApplication>#include <QDesktopWidget>#include <QIcon>#include <QPushButton>#include <QDebug>#include "klfutil.h"#include "klfguiutil.h"
Go to the source code of this file.
Functions | |
| static Qt::WindowFlags | klfpleasewait_flagsForSettings (bool alwaysAbove) |
| KLF_EXPORT void | klfDrawGlowedImage (QPainter *p, const QImage &foreground, const QColor &glowcol, int r, bool also_draw_image) |
| Draws the given image with a glow effect. More... | |
| KLF_EXPORT void klfDrawGlowedImage | ( | QPainter * | painter, |
| const QImage & | foreground, | ||
| const QColor & | glow_color = QColor(128, 255, 128, 8), |
||
| int | radius = 4, |
||
| bool | also_draw_image = true |
||
| ) |
Draws the given image with a glow effect.
Draws a glow effect for image foreground by extracting the alpha channel, and creating fills an image of color glow_color with the same alpha channel. The image is then drawn at all points (x,y) around (0,0) such that |(x,y)-(0,0)| < r, effectively overlapping the glow image with itself creating a blur effect.
The resulting graphics are painted using the painter painter, at the reference position (0,0). If you want your image drawn at another position, use QPainter::translate().
If also_draw_image is TRUE, then the image itself is also drawn on top of the glow effect.
Definition at line 460 of file klfguiutil.cpp.
References QImage::convertToFormat(), QPainter::drawImage(), QImage::format(), QImage::height(), QImage::pixel(), QColor::rgba(), QImage::setPixel(), QImage::size(), and QImage::width().
Referenced by KLFDisplayLabel::display().
|
static |
Definition at line 156 of file klfguiutil.cpp.