Click here to Skip to main content
15,868,016 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Any Difference between vc++ and MFC? Pin
Prakash Nadar4-Jan-06 20:52
Prakash Nadar4-Jan-06 20:52 
QuestionClear difference btwn Copy constructor and Asignment operator? Pin
HaKing3-Jan-06 19:09
HaKing3-Jan-06 19:09 
AnswerRe: Clear difference btwn Copy constructor and Asignment operator? Pin
Prakash Nadar3-Jan-06 19:20
Prakash Nadar3-Jan-06 19:20 
AnswerRe: Clear difference btwn Copy constructor and Asignment operator? Pin
Axter3-Jan-06 19:40
professionalAxter3-Jan-06 19:40 
QuestionQuestion: About VC->Project->Dependencies Pin
xpxl13-Jan-06 19:00
xpxl13-Jan-06 19:00 
Questionabout skin, caption button Pin
HOW WHAT3-Jan-06 18:10
HOW WHAT3-Jan-06 18:10 
Questionhow to display bitmap image Pin
zadlos3-Jan-06 18:02
zadlos3-Jan-06 18:02 
AnswerRe: how to display bitmap image Pin
Owner drawn3-Jan-06 18:10
Owner drawn3-Jan-06 18:10 
There are lots of articles in CP for that.

Here's a brief example from MSDN....

// This OnDraw() handler loads a bitmap from system resources, centers
// it in the view, and uses BitBlt to paint the bitmap bits.

void CMyView::OnDraw(CDC* pDC)
{
  CBlat2Doc* pDoc = GetDocument();
  ASSERT_VALID(pDoc);

  // Load IDB_BITMAP1 from the resources.
  CBitmap bmp;
  if (bmp.LoadBitmap(IDB_BITMAP1))
  {
    // Get the size of the bitmap.
    BITMAP bmpInfo;
    bmp.GetBitmap(&bmpInfo);

    // Create an in-memory device context compatible with the
    // display device context that is used to paint.
    CDC dcMemory;
    dcMemory.CreateCompatibleDC(pDC);

    // Select the bitmap into the in-memory device context.
    CBitmap* pOldBitmap = dcMemory.SelectObject(&bmp);

    // Find a center point for the bitmap in the client area.
    CRect rect;
    GetClientRect(&rect);
    int nX = rect.left + (rect.Width() - bmpInfo.bmWidth) / 2;
    int nY = rect.top + (rect.Height() - bmpInfo.bmHeight) / 2;

    // Copy the bits from the in-memory device context to the on-
    // screen device context to do the painting. Use the computed center
    // point for the target offset.
    pDC->BitBlt(nX, nY, bmpInfo.bmWidth, bmpInfo.bmHeight, &dcMemory,
      0, 0, SRCCOPY);

    dcMemory.SelectObject(pOldBitmap);
  }
  else
    TRACE0("ERROR: Where is IDB_BITMAP1?\n");
}


As far as Zoom in and out are concerned I think you can use StretchBlt.

Jesus Loves You and Me Smile | :)
<marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord


GeneralRe: how to display bitmap image Pin
zadlos3-Jan-06 23:24
zadlos3-Jan-06 23:24 
QuestionHTML and C++ Pin
Deys3-Jan-06 17:32
Deys3-Jan-06 17:32 
AnswerRe: HTML and C++ Pin
S Douglas3-Jan-06 19:01
professionalS Douglas3-Jan-06 19:01 
QuestionSpanning monitors with PIX from XDK Pin
lastgen3-Jan-06 15:26
lastgen3-Jan-06 15:26 
AnswerRe: Spanning monitors with PIX from XDK Pin
lastgen4-Jan-06 17:20
lastgen4-Jan-06 17:20 
QuestionTab Background Color Pin
TKnapp3-Jan-06 12:26
TKnapp3-Jan-06 12:26 
QuestionButton fore color? Pin
G Haranadh3-Jan-06 9:00
G Haranadh3-Jan-06 9:00 
QuestionRe: Button fore color? Pin
David Crow3-Jan-06 9:24
David Crow3-Jan-06 9:24 
Questionreading/writing to a textfile Pin
RabiaAslam3-Jan-06 8:45
RabiaAslam3-Jan-06 8:45 
QuestionRe: reading/writing to a textfile Pin
David Crow3-Jan-06 9:25
David Crow3-Jan-06 9:25 
AnswerRe: reading/writing to a textfile Pin
Klerik823-Jan-06 13:07
Klerik823-Jan-06 13:07 
AnswerRe: reading/writing to a textfile Pin
ThatsAlok4-Jan-06 0:52
ThatsAlok4-Jan-06 0:52 
QuestionSpell check in an MFC UI Pin
PrashantJ3-Jan-06 8:29
PrashantJ3-Jan-06 8:29 
AnswerRe: Spell check in an MFC UI Pin
Sheng Jiang 蒋晟3-Jan-06 17:28
Sheng Jiang 蒋晟3-Jan-06 17:28 
QuestionClassWizard for Visual Studio 2005 Pin
DanYELL3-Jan-06 4:39
DanYELL3-Jan-06 4:39 
AnswerRe: ClassWizard for Visual Studio 2005 Pin
Rob Caldecott3-Jan-06 5:01
Rob Caldecott3-Jan-06 5:01 
GeneralRe: ClassWizard for Visual Studio 2005 Pin
DanYELL3-Jan-06 6:10
DanYELL3-Jan-06 6:10 

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.