Hi all, I'm new to the forum!
I have a problem with QImage::save(); it works ok in debug, but when I use it in release it returns always false.
I'm using Qt 4.6; Does anybody have idea of what can be the problem?
Thank you.
Hi all, I'm new to the forum!
I have a problem with QImage::save(); it works ok in debug, but when I use it in release it returns always false.
I'm using Qt 4.6; Does anybody have idea of what can be the problem?
Thank you.
Did you run the application directly (by running the exe) or do you run it from the IDE?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
First of all Excuse me for the delay on the response.
I run the the application directly.
Hmm... can you show your code?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
I saw that the problem occurs only with JPG and TIFF format; with BMP and PNG works fine also in release;
however the code I used is:
typedef unsigned char LMV_UC;
bool ApplicationCommands::saveScreenshot(){
QSettings settings;
QString fileName;
QString str_extention, str_extention_complete;
//***get last path from settings
QString imageSavePath = settings.value("refPathImageSave", QString(QDir::homePath())).toString();
//***this is my custom dialog to choose the file name and type of the file to save
ScreenshotDialog* CSD = new CuboScreenshotDialog();
if ( CSD->exec() ){
//***this is a method to get the image like screenshot of a custom window;
//***it creates the image in this way:
//***LMV_UC* rawImage = (LMV_UC*)calloc( sizeof( LMV_UC ), 4*extendedWidth*extendedHeight);
//*** <--fills the rawImage by reading pixel from window-->
//***image = QImage ( rawImage, extendedWidth, extendedHeight, QImage::Format_RGB32 );
QImage image;
if ( !openglView->getScreenshot(image) ){
return false;
}
//***gets the file name to save...
fileName = CSD->getFileName();
//***...and the quality
short quality = CSD->getQuality();
//***image saving...
return( image.save(fileName, 0, quality) );
}
return false;
}
Last edited by CCTeam; 26th May 2010 at 17:35.
Bookmarks