summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/src_gui_image_qimagewriter.cpp
blob: d4a41187e47951ef2aabde9c3a258b93aaeefc3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//! [0]
QImageWriter writer;
writer.setFormat("png"); // same as writer.setFormat("PNG");
//! [0]


//! [1]
QImage image("some/image.jpeg");
QImageWriter writer("images/outimage.png", "png");
writer.setText("Author", "John Smith");
writer.write(image);
//! [1]


//! [2]
QImageWriter writer(fileName);
if (writer.supportsOption(QImageIOHandler::Description))
    writer.setText("Author", "John Smith");
//! [2]
ass="hl com">** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ //! [0] Q_IPV6ADDR addr = hostAddr.toIPv6Address(); // addr contains 16 unsigned characters for (int i = 0; i < 16; ++i) { // process addr[i] } //! [0]