Kein passender Konstruktor für QImage
Verfasst: Mittwoch 28. September 2011, 19:01
Hallo,
ich möchte gerne meine 8-Bit Graufstufenbilder (TIFF-Format) als QImage öffnen und dabei gleich als Format QImage.Format_RGB16. Denn mit
wird das TIF automatisch als Format_Indexed8 geöffnet und da kann ich keinen QPainter benutzen, ohne es vorher zu konvertieren. Daher benutze ich doch gleich:
Das Problem dabei ist aber folgendes:
Weiß jemand, was das bedeuten soll? Laut riverbankcomputing.co.uk ist format einer der Werte aus dem Format-enum. Ich hätte gemeint, der dritte Konstruktor von unten würde meinen Parametern entsprechen. Aber anscheinend ist dem nicht so.
Was bedeutet eigentlich dieser Zusatz "str" vor Format? String? Wie passt das mit dem Format-Enum zusammen, das nur Integers liefert? Wenn ich direkt die entsprechende Zahl hinschreibe, geht's auch nicht.
Viele Grüße
antimatter
ich möchte gerne meine 8-Bit Graufstufenbilder (TIFF-Format) als QImage öffnen und dabei gleich als Format QImage.Format_RGB16. Denn mit
Code: Alles auswählen
QImage('bild.tif')
Code: Alles auswählen
QImage('bild.tif', QImage.Format_RGB16)
Code: Alles auswählen
TypeError: arguments did not match any overloaded call:
QImage(): too many arguments
QImage(QSize, QImage.Format): argument 1 has unexpected type 'str'
QImage(int, int, QImage.Format): argument 1 has unexpected type 'str'
QImage(str, int, int, QImage.Format): not enough arguments
QImage(sip.voidptr, int, int, QImage.Format): argument 1 has unexpected type 'str'
QImage(str, int, int, int, QImage.Format): not enough arguments
QImage(sip.voidptr, int, int, int, QImage.Format): argument 1 has unexpected type 'str'
QImage(list-of-str): argument 1 has unexpected type 'str'
QImage(QString, str format=None): argument 2 has unexpected type 'Format'
QImage(QImage): argument 1 has unexpected type 'str'
QImage(QVariant): too many arguments
Was bedeutet eigentlich dieser Zusatz "str" vor Format? String? Wie passt das mit dem Format-Enum zusammen, das nur Integers liefert? Wenn ich direkt die entsprechende Zahl hinschreibe, geht's auch nicht.
Viele Grüße
antimatter