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
>
4
namespace
image
{
5
void
wrapper0
() {
6
7
//! [0]
8
QImage image;
9
QByteArray ba;
10
QBuffer buffer(&ba);
11
buffer.open(QIODevice::WriteOnly);
12
image.save(&buffer,
"PNG"
);
// writes image into ba in PNG format
13
//! [0]
14
15
}
// wrapper0
16
17
18
void
wrapper1
() {
19
20
//! [1]
21
QPixmap pixmap;
22
QByteArray bytes;
23
QBuffer buffer(&bytes);
24
buffer.open(QIODevice::WriteOnly);
25
pixmap.save(&buffer,
"PNG"
);
// writes pixmap into bytes in PNG format
26
//! [1]
27
28
}
// wrapper1
29
30
}
// image
image
Definition
image.cpp:4
image::wrapper0
void wrapper0()
Definition
image.cpp:5
image::wrapper1
void wrapper1()
Definition
image.cpp:18
qtbase
src
gui
doc
snippets
image
image.cpp
Generated on Mon Mar 10 2025 00:41:01 for Qt by
1.13.2