Disappearing images
-
I have a really irritating problem. In my program, a user can browse images by clicking on two buttons (one going forward and one backwards). After a while the images are no longer displayed. The area is updated, but instead of displaying the image, the area is white. The shape is still visible though (and updated if I continue browsing) and it is correct. Also the image data to be displayed is correct, as I have seen when debugging the application. But there is no real image displayed to the user, only a white rectangle of the image. The buttons that I use are of a CButton-derrived class that I call ImageButton. At the same time as the image dissapears, the images dissapear from the buttons too! This occurs after browsing about 200 images, the exact amount is random. What could be the problem? I am thankful for all comments! /Killen
-
I have a really irritating problem. In my program, a user can browse images by clicking on two buttons (one going forward and one backwards). After a while the images are no longer displayed. The area is updated, but instead of displaying the image, the area is white. The shape is still visible though (and updated if I continue browsing) and it is correct. Also the image data to be displayed is correct, as I have seen when debugging the application. But there is no real image displayed to the user, only a white rectangle of the image. The buttons that I use are of a CButton-derrived class that I call ImageButton. At the same time as the image dissapears, the images dissapear from the buttons too! This occurs after browsing about 200 images, the exact amount is random. What could be the problem? I am thankful for all comments! /Killen
Looks like your app leaks GDI resources. If you are using Windows 2000 or XP you can monitor the available GDI objects through the "Processes" tab of the Task Manager. Just add the "GDI Objects" column. In Windows 9x you have to right click on "My Computer" and open the properties. One of the tabs should have "System Resources". Run your app and look at the available GDI resources. Then load a few images and look again. Do not close your app. If the GDI resources decrease you have a GDI leak. To find the GDI leak use BoundsChecker or Purify. Or simply look through your code and make sure you release icons, images, etc. Also make sure you select all previous GDI objects back in case you are using CDC::SelectObject(). Ivor S. Sargoytchev Dundas Software
-
I have a really irritating problem. In my program, a user can browse images by clicking on two buttons (one going forward and one backwards). After a while the images are no longer displayed. The area is updated, but instead of displaying the image, the area is white. The shape is still visible though (and updated if I continue browsing) and it is correct. Also the image data to be displayed is correct, as I have seen when debugging the application. But there is no real image displayed to the user, only a white rectangle of the image. The buttons that I use are of a CButton-derrived class that I call ImageButton. At the same time as the image dissapears, the images dissapear from the buttons too! This occurs after browsing about 200 images, the exact amount is random. What could be the problem? I am thankful for all comments! /Killen
Sounds like you are running out of resources. Are you making sure you delete the images no longer showing?
-
Looks like your app leaks GDI resources. If you are using Windows 2000 or XP you can monitor the available GDI objects through the "Processes" tab of the Task Manager. Just add the "GDI Objects" column. In Windows 9x you have to right click on "My Computer" and open the properties. One of the tabs should have "System Resources". Run your app and look at the available GDI resources. Then load a few images and look again. Do not close your app. If the GDI resources decrease you have a GDI leak. To find the GDI leak use BoundsChecker or Purify. Or simply look through your code and make sure you release icons, images, etc. Also make sure you select all previous GDI objects back in case you are using CDC::SelectObject(). Ivor S. Sargoytchev Dundas Software
-
I have a really irritating problem. In my program, a user can browse images by clicking on two buttons (one going forward and one backwards). After a while the images are no longer displayed. The area is updated, but instead of displaying the image, the area is white. The shape is still visible though (and updated if I continue browsing) and it is correct. Also the image data to be displayed is correct, as I have seen when debugging the application. But there is no real image displayed to the user, only a white rectangle of the image. The buttons that I use are of a CButton-derrived class that I call ImageButton. At the same time as the image dissapears, the images dissapear from the buttons too! This occurs after browsing about 200 images, the exact amount is random. What could be the problem? I am thankful for all comments! /Killen
Sounds like you might not be freeing them. If you are loading bitmaps, make sure to use the DeleteObject( HDIOBJECT ) before continuing on. If this doesn't work, try redrawing the object section with the images using the RedrawWindow( HWND, DWORD ) and see if this kicks it.
-
Sounds like you might not be freeing them. If you are loading bitmaps, make sure to use the DeleteObject( HDIOBJECT ) before continuing on. If this doesn't work, try redrawing the object section with the images using the RedrawWindow( HWND, DWORD ) and see if this kicks it.