I want to create a processing script that saves the QGIS MapCanvas exactly as it is seen on the screen and then Zip up the tifw and a created PRJ. The existing QgsMapCanvas.saveAsImage()-method does exactly what I want. Saving to PNG works, but I want TIF. The third argument takes a QString which I'm supposed to provide like QString("TIF").
However I can't seem to work out how to create a QString. It seems the present wrappers around Qt has removed this class. Just sending in a string or a unicode string ( eg u"TIF") does not work.
Nor does the solution in this thread work: QGIS Map tools and Map canvas--QString errors
I'm clueless as to how to get around this problem without rewriting the logic in saveAsImage().
Aucun commentaire:
Enregistrer un commentaire