diff options
Diffstat (limited to 'src/gui/image/qpixmap_raster.cpp')
-rw-r--r-- | src/gui/image/qpixmap_raster.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp index 65e7fb0096..9c9db1c9c1 100644 --- a/src/gui/image/qpixmap_raster.cpp +++ b/src/gui/image/qpixmap_raster.cpp @@ -203,9 +203,14 @@ void QRasterPlatformPixmap::fill(const QColor &color) pixel = qPremultiply(color.rgba()); const QPixelLayout *layout = &qPixelLayouts[image.format()]; layout->convertFromARGB32PM(&pixel, &pixel, 1, layout, 0); - } else { + } else if (image.format() == QImage::Format_Alpha8) { + pixel = qAlpha(color.rgba()); + } else if (image.format() == QImage::Format_Grayscale8) { + pixel = qGray(color.rgba()); + } else + { pixel = 0; - // ### what about 8 bits + // ### what about 8 bit indexed? } image.fill(pixel); |