|
-
May 6th, 1999, 09:58 AM
#1
How to save a copy of CDC for later use?
I am trying to draw text on the screen in a fast speed. The drawing is triggered by a timer constantly.
In the painting routine, I have to get a DC, select fonts and colors, and then release the DC and unselect the fonts.
This is done everytime the timer is triggered, which makes the drawing way too slow.
I am wondering if there is a way the CDC can be saved and used later. Thanks.
Here is what I am doing now:
void MyClass::OnTimer(...)
{
PaintText();
}
void MyClass::PaintText()
{
CDC *pDC=GetDC();
CFont *pOld;
pOld = pDC->SelectObject(font);
pDC->SetTextColor(txtColor);
pDC->SetBkColor(bkColor);
pDC->TextOut(......);
pDC->SelectObject(pOld);
ReleaseDC(pDC);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|