Display updated bitmap

Posted on 2004-11-27
Medium Priority
Last Modified: 2013-11-20

I am new to MFC programming. Please help!
My program use onDraw to display a bitmap to screen initially. After the user press "Convert" button, it will trigger the OnConvert function to modify the bit of this bitmap. And display again.

My problem is how to get pDC in OnConvert function.

void CMFCView::OnDraw(CDC* pDC)

pDC->StretchBlt(0, 0, iClientWidth, iClientHeight, &dcMemory, 0, 0, iBpWidth, iBpHeight, SRCCOPY);

void CMFCView::OnConvert()

Question by:smallee
LVL 55

Accepted Solution

Jaime Olivares earned 480 total points
ID: 12686888
Don't need this, after converting bitmap call Invalidate(TRUE) to force repaint.

Author Comment

ID: 12688680

but if i want to reset the iBpWidth and iBpHeight to a new value in OnConvert function

how can i do it?

Assisted Solution

Ruskialt earned 320 total points
ID: 12689431
Create a bitmap of required size and select it into the dcMemory. "Selecting an image into a dc" means, that this is a bitmap that is drawn to.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question