Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

About vc++.....

0 views
Skip to first unread message

令人頭痛的MFC

unread,
Aug 25, 2000, 3:00:00 AM8/25/00
to
在製做選取功能的八個小方格時,程式碼如下:

int nHandSize = GetSystemMetrics(SM_CXBORDER) * 7;

// Create an inflated rect around the shape's bounding
// rect, m_boxShape.
CRect ri = m_boxShape;
ri.InflateRect(nHandSize, -nHandSize);

// Calculate rects for corner handles.

// Left top corner selection handle
CRect rectLeftTop(ri.left, ri.top,
m_boxShape.left, m_boxShape.top);
rectLeftTop.OffsetRect(4, -4);
arHandles[0] = rectLeftTop;

問題一:
請問 GetSystemMetrics(SM_CXBORDER) * 7;是做什麼用的.

問題二:
使用InflateRect不就是會將原來圖形膨脹嗎?
rectLeftTop(ri.left, ri.top m_boxShape.left, m_boxShape.top);
不就是兩個矩形的左上角形成一個新的小的矩形嗎,
那麼若將這個小矩形置中,則OffsetRect的座標應該是(4,4)而非(4,-4)吧!
--
[1;32m※ Origin: [33m台灣科大電子站 [37m<bbs.et.ntust.edu.tw> [m
[1;31m◆ From: [36m140.118.41.107 [m

0 new messages