I use a dialog in MFC to load and show a bmp successfully, I use a picture control , now I want to mark part of the bmp with red color with the following code:
for( int i = 200; i < 300; i++)
for(int j = 200; j < 300; j++)
the red part disappeared at once as the bmp was loaded, I just can not make the bmp and the red part I marked show at the same time, can anyone help me with this ,thank you very much,
the following is part of my code to load the bmp:
m_st1.GetClientRect( &rectStaticClient ); // define a variable of the picture control: CStatic m_st1
m_st1.ClientToScreen( &rectStaticClient );
GetObject( m_hBmpNew , sizeof(BITMAP), &m_bmInfo );
Last edited by Angela2010; November 5th, 2011 at 08:39 PM.
Write your own class derived from CStatic. In its WM_PAINT message handler draw bitmap, and then red overlay over it. There are several ways to draw bitmap, for example, you can use StretchDIBits function.
To use this class, create CStatic dialog member variable with MFC Class Wizard, and replace CStatic type with your own class.