1、 picture 控制元件畫矩形可以任意拖動
uj5u.com熱心網友回復:

類似于這種
uj5u.com熱心網友回復:
CRectTracker m_Tracker;#define TRACK_SIZE 128
void CPartialBitmapView::OnInitialUpdate()
{
CView::OnInitialUpdate();
//
CRect rc;
GetClientRect(&rc);
CPoint pt=rc.CenterPoint();
rc.left=pt.x-TRACK_SIZE/2;
rc.right=pt.x+TRACK_SIZE/2;
rc.top=pt.y-TRACK_SIZE/2;
rc.bottom=pt.y+TRACK_SIZE/2;
m_Tracker.m_rect=rc;
m_Tracker.m_nStyle |= CRectTracker::solidLine;
m_Tracker.m_nStyle |= CRectTracker::resizeInside;
}
uj5u.com熱心網友回復:
Implementing Activation by Using a Mouse Clickuj5u.com熱心網友回復:
GreenOpenPaint的實作(五)矩形框http://www.cnblogs.com/jsxyhelu/p/6354341.html
已經完全實作帶代碼,只是需要你去讀懂。
uj5u.com熱心網友回復:
聽說PhotoShop 1.0的源代碼都公開了!uj5u.com熱心網友回復:
crecttraker可以去研究下,跟微軟的一樣帶8個小爪uj5u.com熱心網友回復:
CRectTracker
CRectTracker does not have a base class.
The CRectTracker class allows an item to be displayed, moved, and resized in different fashions. Although the CRectTracker class is designed to allow the user to interact with OLE items by using a graphical interface, its use is not restricted to OLE-enabled applications. It can be used anywhere such a user interface is required.
CRectTracker borders can be solid or dotted lines. The item can be given a hatched border or overlaid with a hatched pattern to indicate different states of the item. You can place eight resize handles on either the outside or the inside border of the item. (For an explanation of the resize handles, see GetHandleMask.) Finally, a CRectTracker allows you to change the orientation of an item during resizing.
To use CRectTracker, construct a CRectTracker object and specify which display states are initialized. You can then use this interface to give the user visual feedback on the current status of the OLE item associated with the CRectTracker object.
For more information on using CRectTracker, see the articleTrackers in Visual C++ Programmer’s Guide.
#include <afxext.h>
Class Members | Hierarchy Chart
Samples MFC Sample TRACKER | MFC Sample DRAWCLI
See Also COleResizeBar, CRect, CRectTracker::GetHandleMask
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/88146.html
標籤:圖形處理/算法
