diff options
author | deva <deva> | 2005-11-16 10:15:38 +0000 |
---|---|---|
committer | deva <deva> | 2005-11-16 10:15:38 +0000 |
commit | d82090afef813e059d80b09311e5221d64dd6201 (patch) | |
tree | b7c67f6193e8f414c894f53073bdb7a4f5576832 /src/yuv_draw.cc | |
parent | 546c4ec72435c25b5cd0bf927e98c08ec2c072ac (diff) |
*** empty log message ***
Diffstat (limited to 'src/yuv_draw.cc')
-rw-r--r-- | src/yuv_draw.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/yuv_draw.cc b/src/yuv_draw.cc index a444fa7..bb8b23f 100644 --- a/src/yuv_draw.cc +++ b/src/yuv_draw.cc @@ -143,7 +143,42 @@ void YUVDraw::draw() } } +static QImage *loadIcon( char *name, int height ) +{ + QImage scaled; + QImage *img; + + img = new QImage(); + img->load( name ); + + int h = height; + int w = (int)((float)img->width() / (float)(img->height() / (float)h)); + scaled = img->smoothScale(w, h); + delete img; + img = new QImage(scaled); + + return img; +} +#include "mainwindow.h" +void YUVDraw::mute(bool muted) +{ + int xoffset = 0; + int yoffset = 0; + int width = 48; + int height = 48; + + QImage *img = loadIcon(PIXMAP_UNMUTE, height); + + // Swicth the bool and draw an mute/unmute symbol + for(int x = 0; x < width; x++) { + for(int y = 0; y < height; y++) { + unsigned char color = qGray(img->pixel(x, y)); + if(!qAlpha(img->pixel(x, y))) color = 0; + addPixel(x + xoffset, y + yoffset, color); + } + } +} |