image loading problem using qpixmap
i am developing an application,which needs to load the image dynamically. The images are in the memory.Each time it load may be the same image or a different one. I am using the code as follows
QPixmap image;
QPixmap largePixmap;
image.load("c://Data/image.png");
largePixmap.load("c://Data/image1.png");
Defining in the constructor.
For the 1st time when application start and the object created everything working fine.
But when i came back again call the same class it showing the error image can not load.
Can any one tell what is the problem and how to overcome from the problem
please help!
Re: image loading problem using qpixmap
sorry, can you rephrase that and maybe show some compilable code?
(Reading your description several times I do not understand your problem.)
Re: image loading problem using qpixmap
You called the same instance of the class? Or a different one? Ex:
Code:
class LoadImg
{
private:
image.load("c://Data/image.png");
largePixmap.load("c://Data/image1.png");
public:
showagain()
{
// show images , etc
}
}
LoadImg img; // image works
img.showagain(); // doesnt work
// or:
LoadImg img; // image works
LoadImg img2; // doesnt work
Re: image loading problem using qpixmap
yes i called the same instance.
Again if the i reduces the image size it will work for 2-3 times. Then problem arises.
how do i overcome from the problem.
If u please
Re: image loading problem using qpixmap
With the amount of information you gave, your error is not reproducible. Please post the code you're using to load and display the images.