File indexing completed on 2024-04-28 03:59:18

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2004 Antonio Larrosa <larrosa@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #include "kpixmapregionselectordialog.h"
0009 #include <QApplication>
0010 #include <QFile>
0011 #include <QImage>
0012 #include <QPixmap>
0013 #include <iostream>
0014 
0015 int main(int argc, char **argv)
0016 {
0017     QApplication app(argc, argv);
0018 
0019     if (argc <= 1) {
0020         std::cerr << "Usage: kpixmapregionselectordialogtest <imageFile>" << std::endl;
0021         return 1;
0022     }
0023 
0024     QPixmap pix(QFile::decodeName(argv[1]));
0025     QImage image = KPixmapRegionSelectorDialog::getSelectedImage(pix, 100, 100);
0026     image.save(QStringLiteral("output.png"), "PNG");
0027 
0028     return 0;
0029 }