sriprabha
21st February 2015, 07:07
Hi,
I'm a newbie in Qt.
I'm trying to read a png image from disk.
But load return false. The image size is around 350x250 and OS is windows. I'm using qt 4.8.4 built in 64bit, debug mode.
The programming environment is Visual Studio 2010.
I tried following options
QString file = "D:\\a.png";
QFileInfo fileInfo(file);
bool fileValid = fileInfo.exists(); // this gives true
QImage image;
bool loadStat = image.load(file); // this returns false
QPixmap imgPix;
bool pixStat = imgPix.load(file); // this returns false
QImageReader *imageRead = new QImageReader(file);
bool readstat = imageRead->canRead(); //this also false
I'm not sure what this wrong. I want to read this image and print it.
Any suggestions?
Thanks,
R.Sriprabha
I'm a newbie in Qt.
I'm trying to read a png image from disk.
But load return false. The image size is around 350x250 and OS is windows. I'm using qt 4.8.4 built in 64bit, debug mode.
The programming environment is Visual Studio 2010.
I tried following options
QString file = "D:\\a.png";
QFileInfo fileInfo(file);
bool fileValid = fileInfo.exists(); // this gives true
QImage image;
bool loadStat = image.load(file); // this returns false
QPixmap imgPix;
bool pixStat = imgPix.load(file); // this returns false
QImageReader *imageRead = new QImageReader(file);
bool readstat = imageRead->canRead(); //this also false
I'm not sure what this wrong. I want to read this image and print it.
Any suggestions?
Thanks,
R.Sriprabha