[Qt-interest] Saving monochrome image

Constantin Makshin dinosaur-rus at users.sourceforge.net
Sat Aug 15 22:07:23 CEST 2009


Try using QImage::convertToFormat() function to convert your image.

On Sat, 15 Aug 2009 22:43:56 +0400, M. Bashir Al-Noimi <mbnoimi at gmx.com>  
wrote:
> Hi All,
>
> I want to save a QImage object in monochrome format (1 Bit Back and
> White) so I'm using the following code for that:
>
>     QImage result("RGB.tif", QImage::Format_RGB32);
>     QBitmap::fromImage(result, Qt::MonoOnly).save("BW.tif");
>
>
> but the resultant format of the image is RGB!!!
>
> How I can save QImage object in monochrome format ?

-- 
Constantin "Dinosaur" Makshin



More information about the Qt-interest-old mailing list