QImage (..) & QImage::save() always return NULL value - why?
Hi, I'm having the following problem:
I'm creating an object And tring to save it
Code:
image.save("smth.jpg","JPG");
image.save returns NULL - why?
Save function works for images being loaded and doesn't for those I create myself
My operating system is winXP, QT ver 3.3.3, VS.NET 2003...
Sorry if this question is too simple to be posted... still I cant find a solution. :confused:
Thanks a lot for your time.
GREG.
Re: QImage (..) & QImage::save() always return NULL value - why?
Did you try "JPEG" instead of "JPG"? Was your Qt built with JPEG support? What does QImageIO::outputFormats() return?
Re: QImage (..) & QImage::save() always return NULL value - why?
Quote:
Did you try "JPEG" instead of "JPG"?
Tried to - no difference...
Quote:
Was your Qt built with JPEG support?
Yes, sure - Loaded images are saved without any troubles.
Quote:
What does QImageIO :: outputFormats() return?
Never tried it... I will tomorrow - Don't have a QT installed here to try your advises. If you have a working example consisting of creation and saving an QImage object , pls, post it here. :o
Thanks a lot for your help!
Re: QImage (..) & QImage::save() always return NULL value - why?
Vladimir Ostapenko has told me a solution, so I'm posting a working code:
Code:
image.save(str,"JPEG");
Anybody knows , why QString is necessary ?