Hi !

I have a widget for playing animations (an animation is constituted of many PNG or JPG files) an something strange occured in the paintEvent function of my widget, I simply do :
Qt Code:
  1. void CAnimation::paintEvent(QPaintEvent* event)
  2. {
  3. if( this->isShown )
  4. {
  5. QPixmap pixmap(images[imageCurrentIndex]);
  6. QRect rect(event->rect());
  7. bitBlt(this, rect.topLeft(), &pixmap);
  8. }
  9. }
To copy to clipboard, switch view to plain text mode 

images and imageNames are defined as follow :
Qt Code:
  1. QStringList imageNames;
  2. QMap <int, QPixmap>images;
To copy to clipboard, switch view to plain text mode 

and initialised like this :
Qt Code:
  1. int CAnimation::setImageNames(QStringList values)
  2. {
  3. // Update property
  4. this->imageNames = values;
  5.  
  6. // Load images
  7. int index = 0;
  8. for ( QStringList::Iterator it = imageNames.begin(); it != imageNames.end(); ++it )
  9. {
  10. images[index] = QPixmap(*it);
  11. index++;
  12. }
  13.  
  14. return 0;
  15. }
To copy to clipboard, switch view to plain text mode 

So, here is my problem : when my animation contains more than a specific number of images I have the following debug trace and the image is not displayed :
Qt Code:
  1. ASSERT: "src_dc && dst_dc" in kernel\qpaintdevice_win.cpp (388)
To copy to clipboard, switch view to plain text mode 
... in fact when I have an animation with more than 165 images, each time I'm trying to display the image of index greather than 166 I have this problem.

I first thought my last images were bugged but I did the following test : I just load images from index 100 to 175 (my animation has 175 images) and this time I do not have the problem and my last images are correctly displayed.

Isn't it a problem of memory ? How could I correct this (allocation more memory for my application for example).

Thanks in advance.