From 4c9d7c2da5f8cab2c34b25ee95721471e2618643 Mon Sep 17 00:00:00 2001 From: John Levon Date: Sun, 17 Nov 2002 10:49:45 +0000 Subject: [PATCH] Implement monochrome, and fake grayscale with it git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5658 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 4 ++++ src/frontends/qt2/QLImage.C | 35 +++++++++++++++-------------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 52c9a2a257..4c7c8af0f1 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2002-11-17 John Levon + + * QLImage.C: implement monochrome, and fake grayscale + 2002-11-17 John Levon * qfont_loader.h: diff --git a/src/frontends/qt2/QLImage.C b/src/frontends/qt2/QLImage.C index 787bc17aa8..d7e1382d55 100644 --- a/src/frontends/qt2/QLImage.C +++ b/src/frontends/qt2/QLImage.C @@ -160,26 +160,21 @@ bool QLImage::setPixmap(Params const & params) lyxerr[Debug::GRAPHICS] << "setPixmap()" << endl; -// FIXME -#if 0 - int color_key; + // FIXME: it's a fake kind of grayscale ! + switch (params.display) { - case MonochromeDisplay: - color_key = FL_IMAGE_MONO; - break; - case GrayscaleDisplay: - color_key = FL_IMAGE_GRAY; - break; - case ColorDisplay: - default: // NoDisplay cannot happen! - color_key = FL_IMAGE_RGB; - break; - } - - if (color_key != FL_IMAGE_RGB) { - flimage_convert(image_, color_key, 0); + case GrayscaleDisplay: + case MonochromeDisplay: { + QImage i(xformed_pixmap_.convertToImage()); + xformed_pixmap_.convertFromImage(i, QPixmap::Mono); + break; + } + + default: + break; } - +// FIXME +#if 0 unsigned int fill = packedcolor(LColor::graphicsbg); if (fill != image_->fill_color) { // the background color has changed. @@ -217,8 +212,8 @@ void QLImage::clip(Params const & params) return; int const xoffset_l = params.bb.xl; - int const yoffset_t = ( pixmap_.height() > params.bb.yt ? - pixmap_.height() - params.bb.yt : 0 ); + int const yoffset_t = (pixmap_.height() > params.bb.yt ? + pixmap_.height() - params.bb.yt : 0); xformed_pixmap_.resize(new_width, new_height); QPainter p; -- 2.39.5