Code: Alles auswählen
QImageReader ( const QString & fileName, const QByteArray & format = QByteArray() )Aber in Zukunft werde ich mich noch mehr anstrengen und versuchen zu verstehen was damit gemeint ist.
Code: Alles auswählen
QImageReader ( const QString & fileName, const QByteArray & format = QByteArray() )So was steht auch immer drinnen.nici hat geschrieben:Aber da steht dann immer z.B. sowas wieund da wüsste ich nichts mit dem QByteArray & format anzufangen.Code: Alles auswählen
QImageReader ( const QString & fileName, const QByteArray & format = QByteArray() )
Code: Alles auswählen
QList<QByteArray> QImageReader::supportedImageFormats () [static]
Returns the list of image formats supported by QImageReader.
By default, Qt can read the following formats:
Format
Description
BMP
Windows Bitmap
GIF
Graphic Interchange Format (optional)
JPG
Joint Photographic Experts Group
JPEG
Joint Photographic Experts Group
MNG
Multiple-image Network Graphics
PNG
Portable Network Graphics
PBM
Portable Bitmap
PGM
Portable Graymap
PPM
Portable Pixmap
TIFF
Tagged Image File Format
XBM
X11 Bitmap
XPM
X11 Pixmap
Reading and writing SVG files is supported through Qt's SVG Module.Code: Alles auswählen
QImageReader ( const QString & fileName, const QByteArray & format = QByteArray() )Code: Alles auswählen
void Pfusche(int Ein1, int &Ein2);
int main()
{
int Zaehler = 7, Index = 12;
std::cout << "Die Werte sind ";
printf("%3d %3d\n", Zaehler, Index);
Pfusche(Zaehler, Index);
std::cout << "Die Werte sind ";
printf("%3d %3d\n", Zaehler, Index);
return 0;
}
void Pfusche(int Ein1, int &Ein2)
{
Ein1 = Ein1 + 100;
Ein2 = Ein2 + 100;
std::cout << "Die Werte sind ";
printf("%3d %3d\n", Ein1, Ein2);
}
// Ergebnis beim Ausführen
//
// Die Werte sind 7 12
// Die Werte sind 107 112
// Die Werte sind 7 112Code: Alles auswählen
void QImageIOHandler::setFormat ( const QByteArray & format )
Sets the format of the QImageIOHandler to format. The format is most useful for handlers that support multiple image formats.
See also format().By default, Qt can read the following formats:
Format
Description
BMP
Windows Bitmap
GIF
Graphic Interchange Format (optional)
JPG
Joint Photographic Experts Group
JPEG
Joint Photographic Experts Group
MNG
Multiple-image Network Graphics
PNG
Portable Network Graphics
PBM
Portable Bitmap
PGM
Portable Graymap
PPM
Portable Pixmap
TIFF
Tagged Image File Format
XBM
X11 Bitmap
XPM
X11 Pixmap
Naja, der Witz ist hier wohl eher, dass kein neues Objekt erzeugt wird.AuE hat geschrieben:QBytearray erwartet als Übergabepara Referezen von nen QString und nen ByteArray. Dadurch das du via Referenzübergibst kannst du die Werte verändern-wenn deine Fkt fertig ist hast diese Werte in der Aufrufenden Fkt.Code: Alles auswählen
QImageReader ( const QString & fileName, const QByteArray & format = QByteArray() )
Code: Alles auswählen
QString filter = "Images (*.png;; *.xpm;; *.jpg;; *.jpeg;; *.bmp;; *.tiff;; *.xbm)";
QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"),"/home/nurc/untitled.png",filter);
QString suf = QFileInfo(fileName).suffix();
bool QImageIOHandler::canRead() const;
if(!fileName.isEmpty()){
if( filter.contains( suf ) ){
_mPix.toImage().save(fileName);
}else{
QMessageBox::warning(this, "Warnung", "Falsche Dateiendung");
}
}Code: Alles auswählen
connect(imageLabel, SIGNAL(valueChanged(int)),
this, SLOT(setValue(int)));Code: Alles auswählen
#include <QtGui>
int main(int argc, char** argv)
{
QApplication app(argc, argv);
QLabel label;
QPixmap pix("./test.png");
label.setPixmap(pix);
QScrollArea scroll;
scroll.setWidget(&label);
scroll.show();
return app.exec();
}
Code: Alles auswählen
bool QImageIOHandler::canRead() const;