Public://to create a single cache to
//CDlgController dialog
The class CDlgController: public CDialog
{
The class CSingleQueuePic
{
Public:
Int nStartX;
Int nStartY;
Int nWidth;
Int nHeight;
The CDC MemDC;
CBitmap MemBitmap;
HBITMAP m_bitmap;
Int nPicNum;
Public:
CSingleQueuePic ()
{
NStartX=0;
NStartY=0;
NPicNum=0;
NWidth=0;
NHeight=0;
}
Virtual ~ CSingleQueuePic () {}
};
CSingleQueuePic * m_pSingleQueuePic;
COBList
CSingleQueuePic * CreateSinglePage (COBList
};
//DlgController. CPP: implementation file
//to create a single bitmap, the program starts, perform a
CDlgController: : CSingleQueuePic * CDlgController: : CreateSinglePage (COBList
{
CSingleQueuePic * pSingleQueuePic=new CSingleQueuePic;
PSingleQueuePic - & gt; NStartX=0;
PSingleQueuePic - & gt; NStartY=0;
PSingleQueuePic - & gt; NPicNum=nNum;
//double cache refresh again when the splash screen solution 20181110
Int nWidth=m_recQueueCall. Width ();
Int nHeight=m_recQueueCall. Height ();
PSingleQueuePic - & gt; NWidth=nWidth;
PSingleQueuePic - & gt; NHeight=nHeight;
//the CDC MemDC;//define a first display device object
//CBitmap MemBitmap;//define a bitmap object
//then establish a compatible with screen display memory display device
PSingleQueuePic - & gt; MemDC. CreateCompatibleDC (NULL);
//below to create a compatible with screen display bitmap, the size of the bitmap, with the size of the window
PSingleQueuePic - & gt; MemBitmap. CreateCompatibleBitmap (pDC, nWidth, nHeight);
//will be chosen bitmap into memory display device in the
//only the memory for the bitmap display device is drawing, painting on the specified bitmap
CBitmap * pOldBit=pSingleQueuePic - & gt; MemDC. SelectObject (& amp; PSingleQueuePic - & gt; MemBitmap);
//use the background color first bitmap clean
//you can also use you should use the color of the
PSingleQueuePic - & gt; MemDC. FillSolidRect (0, 0, nWidth, nHeight, this - & gt; M_pController - & gt; M_clrControllerBackground);
CFont * pFont=pSingleQueuePic - & gt; MemDC. SelectObject (this - & gt; M_pFontQueueCall);
PDC - & gt; SetBkMode (TRANSPARENT);
Cstrings strBuffer=_T (" drawing test ");
CSize txtsize;
Txtsize=pSingleQueuePic - & gt; MemDC. GetTextExtent (strBuffer);
PSingleQueuePic - & gt; MemDC. TextOut (100, 100, strBuffer);
PSingleQueuePic - & gt; MemDC. SelectObject (pFont);
//copies a figure from a memory to the screen for display
//pDC - & gt; BitBlt (m_recQueueCall m_recQueueCall. Left, top, this - & gt; M_recQueueCall. Width (), and this - & gt; M_recQueueCall. Height (), & amp; PSingleQueuePic - & gt; MemDC, 0, 0, SRCCOPY);
HBITMAP HBITMAP=(HBITMAP) (pSingleQueuePic - & gt; MemBitmap);
This - & gt; SaveBmp (hBitMap, "D: \ \ tes1t BMP");
Return pSingleQueuePic;
}
//loop rolling images, OnTimer (), OnPaint () performed in the
BOOL CDlgController: : DrawQueueCall (pDC) CDC *
{
If (CRunTime: : GetGeneral () - & gt; M_bHideName)
This - & gt; M_bVideo=TRUE;
//
OBPOS POS=NULL;
LONG nLine=0;
//draw
For (CSingleQueuePic * pSingleQueuePic=this - & gt; M_lstSingleQueuePic. GetHead (POS); PSingleQueuePic!=NULL; PSingleQueuePic=this - & gt; M_lstSingleQueuePic. GetNext (POS), nLine++)
{
If (pSingleQueuePic!=NULL & amp; & PSingleQueuePic - & gt; NPicNum==0)
{
PSingleQueuePic - & gt; NStartY -=10;
If (pSingleQueuePic - & gt; NStartY<- m_recQueueCall. Height ())
{
PSingleQueuePic - & gt; NStartY=0;
}
PDC - & gt; BitBlt (m_recQueueCall. Left, m_recQueueCall. Top + pSingleQueuePic - & gt; NStartY, this - & gt; M_recQueueCall. Width (), and this - & gt; M_recQueueCall. Height (), & amp; PSingleQueuePic - & gt; MemDC, 0, 0, SRCCOPY);
}
//InvalidateRect (m_recQueueCall, TRUE);
}
Return TRUE;
}
Mr Using double buffer mechanism, into a bitmap, the rolling cycle, now the problem is mainly image need to change the program, is moving, a great god, please help to see, have two days,
CodePudding user response:
Where is the DrawQueueCall called?CodePudding user response:
Ontimer and onpaint calls, switch can refresh the move, does not automatically move,CodePudding user response: