schau dir mal den Konstruktor an....
dann is der string zum speichern falsch....
mach dir doch einfach mal mit paint eine datei wie im code.... da zeichnest mit paint was rein. und dann kannst drauf gehen.
bei mir klappts so:
Code: Alles auswählen
QImage imgMap("c:\\MAP.bmp");
imgMap.fill(qRgb(255,255,255));
imgMap.save("c:\\MAP.bmp");
so wird z.b. ein komplett rotes bild wieder weiß
EDIT: format braucht man nicht zwingend angeben... er versuchts automatisch zu erkennen...
bool QImage::save ( const QString & fileName, const char * format = 0, int quality = -1 ) const
Saves the image to the file with the given fileName, using the given image file format and quality factor. If format is 0, QImage will attempt to guess the format by looking at fileName's suffix.
The quality factor must be in the range 0 to 100 or -1. Specify 0 to obtain small compressed files, 100 for large uncompressed files, and -1 (the default) to use the default settings.
Returns true if the image was successfully saved; otherwise returns false
[/quote]