GDI画图,矩形框可以任意拖动

rudy6 2017-08-26 10:27:45
1、 picture 控件画矩形可以任意拖动
...全文
498 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2017-08-31
  • 打赏
  • 举报
回复
引用 6 楼 pgao02 的回复:
crecttraker可以去研究下,跟微软的一样带8个小爪
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
pgao02 2017-08-31
  • 打赏
  • 举报
回复
crecttraker可以去研究下,跟微软的一样带8个小爪
赵4老师 2017-08-29
  • 打赏
  • 举报
回复
听说PhotoShop 1.0的源代码都公开了!
jsxyhelu2015 2017-08-27
  • 打赏
  • 举报
回复
GreenOpenPaint的实现(五)矩形框 http://www.cnblogs.com/jsxyhelu/p/6354341.html 已经完全实现带代码,只是需要你去读懂。
rudy6 2017-08-26
  • 打赏
  • 举报
回复


类似于这种
schlafenhamster 2017-08-26
  • 打赏
  • 举报
回复
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; }

19,468

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧