Qt
6.x
The Qt SDK
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
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
14
15
}
// wrapper0
16
17
18
void
wrapper1
() {
19
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
27
28
}
// wrapper1
29
30
}
// image
QBuffer
\inmodule QtCore \reentrant
Definition
qbuffer.h:16
QByteArray
\inmodule QtCore
Definition
qbytearray.h:57
QIODeviceBase::WriteOnly
@ WriteOnly
Definition
qiodevicebase.h:19
QImage
\inmodule QtGui
Definition
qimage.h:37
QPixmap
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition
qpixmap.h:27
image
Definition
image.cpp:4
image::wrapper0
void wrapper0()
Definition
image.cpp:5
image::wrapper1
void wrapper1()
Definition
image.cpp:18
buffer
GLenum GLuint buffer
Definition
qopengles2ext.h:659
ba
QByteArray ba
[0]
Definition
src_corelib_io_qdebug.cpp:31
pixmap
widget render & pixmap
Definition
src_gui_kernel_qwidget.cpp:32
qtbase
src
gui
doc
snippets
image
image.cpp
Generated by
1.9.7