PDA

View Full Version : image loading problem using qpixmap



dutt_004
21st February 2010, 07:21
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!

caduel
21st February 2010, 11:03
sorry, can you rephrase that and maybe show some compilable code?
(Reading your description several times I do not understand your problem.)

been_1990
21st February 2010, 23:40
You called the same instance of the class? Or a different one? Ex:


class LoadImg
{
private:
QPixmap image;
QPixmap largePixmap;
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

dutt_004
22nd February 2010, 06:03
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

been_1990
23rd February 2010, 02:18
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.