Drawing pictures c++ win32
-
I'm developing a game, but the graphics are simple pictures that I show, without any further graphical functionality. I need to know what simple ways I have to show pictures. I tried DirectX 9 textures, but it took a lot of loading time. I'm trying using CImage but something goes wrong. Specifically, when doing
image.Draw()
I get 'debug assertion failed' insideReleaseDc()
. -
I'm developing a game, but the graphics are simple pictures that I show, without any further graphical functionality. I need to know what simple ways I have to show pictures. I tried DirectX 9 textures, but it took a lot of loading time. I'm trying using CImage but something goes wrong. Specifically, when doing
image.Draw()
I get 'debug assertion failed' insideReleaseDc()
.Hanan888 wrote:
...I get 'debug assertion failed' inside ReleaseDc().
What line of what file is asserting?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Hanan888 wrote:
...I get 'debug assertion failed' inside ReleaseDc().
What line of what file is asserting?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
in
<atlimage.h>
, line 1217inline void CImage::ReleaseDC() const throw()
{
HBITMAP hBitmap;ATLASSUME( m\_hDC != NULL ); m\_nDCRefCount--; if( m\_nDCRefCount == 0 ) { hBitmap = HBITMAP( ::SelectObject( m\_hDC, m\_hOldBitmap ) ); **ATLASSERT( hBitmap == m\_hBitmap );** s\_cache.ReleaseDC( m\_hDC ); m\_hDC = NULL; }
}
-
I'm developing a game, but the graphics are simple pictures that I show, without any further graphical functionality. I need to know what simple ways I have to show pictures. I tried DirectX 9 textures, but it took a lot of loading time. I'm trying using CImage but something goes wrong. Specifically, when doing
image.Draw()
I get 'debug assertion failed' insideReleaseDc()
.Can you show the code? What are you calling ReleaseDC() on? The CImage object? You shouldn't be using CImage::GetDC()/CImage::ReleaseDC() when using CImage::Draw(). Mark
Mark Salsbery Microsoft MVP - Visual C++ :java: