Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
image.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3#include <QtGui>
4namespace image {
5void wrapper0() {
6
7//! [0]
8QImage image;
9QByteArray ba;
10QBuffer buffer(&ba);
11buffer.open(QIODevice::WriteOnly);
12image.save(&buffer, "PNG"); // writes image into ba in PNG format
13//! [0]
14
15} // wrapper0
16
17
18void wrapper1() {
19
20//! [1]
21QPixmap pixmap;
22QByteArray bytes;
23QBuffer buffer(&bytes);
24buffer.open(QIODevice::WriteOnly);
25pixmap.save(&buffer, "PNG"); // writes pixmap into bytes in PNG format
26//! [1]
27
28} // wrapper1
29
30} // image
Definition image.cpp:4
void wrapper0()
Definition image.cpp:5
void wrapper1()
Definition image.cpp:18