Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GetClientRect - Size and units querry

Status
Not open for further replies.

sweep123

Technical User
May 1, 2003
185
0
0
GB
With loading a bitmap onto a dialog, the size of the dialog is 500 x 400, but when I look at the values of the rect below, they have the following values 750 x 650 - can someone explan why?

// section of code loading the bitmap onto the dialog.
CRect rect;
GetClientRect(&rect); // returns with 750 and 650?
BITMAP bm;
m_BitmapData.GetBitmap(&bm);

//Change the coordinates and zoom values as you need, the below places the bitmap to the center
m_nX1 = rect.left + (rect.Width() - bm.bmWidth) / 2 ;
m_nY1 = rect.top + (rect.Height() - bm.bmHeight) / 2;
m_nX2 = m_nX1 + bm.bmWidth;
m_nY2 = m_nY1 + bm.bmHeight;
m_flZoomX = 0.0f; // Still to do
m_flZoomY = 0.0f;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top