开发者

Are there any predefined functions in Qt which save a QImage object to a JPG/PNG/BMP file?

Pretty simple questi开发者_运维问答on .. Are there any predefined functions in Qt which save a QImage object to a JPG/PNG/BMP file ?


This is exactly what you'll need:

http://doc.qt.io/qt-5/qimage.html#reading-and-writing-image-files

Google is your friend, but more so are the Qt docs.


The best way is to use QImageReader/QImageWriter. They provide more ability to work with images in comparison to QImage or QPixmap

"QImageReader is specialized class which gives you more control when reading images. For example, you can read an image into a specific size by calling setScaledSize(), and you can select a clip rect, effectively loading only parts of an image, by calling setClipRect(). Depending on the underlying support in the image format, this can save memory and speed up loading of images"

"QImageWriter supports setting format specific options, such as the gamma level, compression level and quality, prior to storing the image"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜