Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: GDI+ DrawImage() Speed Issue Pin
frx9619-Feb-09 23:03
frx9619-Feb-09 23:03 
GeneralRe: GDI+ DrawImage() Speed Issue Pin
Redeye9219-Feb-09 23:11
Redeye9219-Feb-09 23:11 
AnswerRe: GDI+ DrawImage() Speed Issue Pin
KarstenK19-Feb-09 23:21
mveKarstenK19-Feb-09 23:21 
GeneralRe: GDI+ DrawImage() Speed Issue Pin
Redeye9219-Feb-09 23:29
Redeye9219-Feb-09 23:29 
GeneralRe: GDI+ DrawImage() Speed Issue Pin
KarstenK20-Feb-09 0:06
mveKarstenK20-Feb-09 0:06 
AnswerRe: GDI+ DrawImage() Speed Issue Pin
Nishad S19-Feb-09 23:55
Nishad S19-Feb-09 23:55 
GeneralRe: GDI+ DrawImage() Speed Issue Pin
Redeye9220-Feb-09 0:15
Redeye9220-Feb-09 0:15 
GeneralRe: GDI+ DrawImage() Speed Issue Pin
Nishad S20-Feb-09 0:29
Nishad S20-Feb-09 0:29 
Redeye92 wrote:
I just can't see how to keep a hold of the HDC and HBITMAP between calls to OnPaint(),


You can create a memory dc and keep it permanantly (unless the size is changed).

For eg.

void MyDlg::CreateMemDC( CDC* pRefDC, int nWidth, int nHeight )
{
  m_dcMem.CreateCompatibleDC( pRefDC );
  m_bitmapMem.CreateCompatibleBitmap( pRefDC, nWidth, nHeight );
  m_dcMem.SelectObject( &m_bitmapMem );
}

void MyDlg::OnInitDlg()
{
  // some code
  CClientDC dc( this );
  CreateMemDC( &dc, 300, 200 ); // or what ever size you needed
  // draw the image to this m_dcMem
}

void MyDlg::OnPaint()
{
  BitBlt( pDC->m_hDC, .... .... ... , m_dcMem.m_hDC, ...... );
}


Please let me know if not clear enough.

- ns ami -

GeneralRe: GDI+ DrawImage() Speed Issue Pin
Redeye9220-Feb-09 0:54
Redeye9220-Feb-09 0:54 
AnswerRe: GDI+ DrawImage() Speed Issue Pin
Stuart Dootson20-Feb-09 2:40
professionalStuart Dootson20-Feb-09 2:40 
GeneralThe Solution Pin
Redeye9220-Feb-09 3:29
Redeye9220-Feb-09 3:29 
GeneralRe: The Solution Pin
micahferguson28-Feb-09 9:53
micahferguson28-Feb-09 9:53 
GeneralRe: The Solution Pin
Redeye921-Mar-09 21:46
Redeye921-Mar-09 21:46 
QuestionAttempting to get 'Desktop PIDL' on Win2k, Win98 - Bizarre behavior Pin
ab4rum19-Feb-09 21:03
ab4rum19-Feb-09 21:03 
AnswerRe: Attempting to get 'Desktop PIDL' on Win2k, Win98 - Bizarre behavior Pin
Stuart Dootson20-Feb-09 2:59
professionalStuart Dootson20-Feb-09 2:59 
Questionhow to set sound output in left or right side of headphone? Pin
nekokan19-Feb-09 20:06
nekokan19-Feb-09 20:06 
AnswerRe: how to set sound output in left or right side of headphone? Pin
Nishad S20-Feb-09 0:00
Nishad S20-Feb-09 0:00 
QuestionRenaming solution file in vc++ Pin
priyankapriyanka19-Feb-09 19:04
priyankapriyanka19-Feb-09 19:04 
AnswerREPOST: ANSWERED Yesterday! Pin
_AnsHUMAN_ 19-Feb-09 19:13
_AnsHUMAN_ 19-Feb-09 19:13 
AnswerRe: Renaming solution file in vc++ Pin
Chandrasekharan P19-Feb-09 19:32
Chandrasekharan P19-Feb-09 19:32 
GeneralRe: Renaming solution file in vc++ Pin
priyankapriyanka19-Feb-09 22:30
priyankapriyanka19-Feb-09 22:30 
GeneralRe: Renaming solution file in vc++ Pin
Chandrasekharan P19-Feb-09 23:43
Chandrasekharan P19-Feb-09 23:43 
AnswerIt's also time to rename your post. Pin
CPallini19-Feb-09 21:53
mveCPallini19-Feb-09 21:53 
Questionlogging optimization. Pin
vikramlinux19-Feb-09 19:00
vikramlinux19-Feb-09 19:00 
AnswerRe: logging optimization. Pin
KarstenK19-Feb-09 23:24
mveKarstenK19-Feb-09 23:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.