摘要: 双缓冲说白就是贴图,将数据全部绘制在缓冲兼容DC上,再将兼容DC的数据一次全部绘制在屏幕上。相较直接在DC上绘图,双缓冲是将绘制数据全部输出,而非分步绘制,并且,可以避免Windows刷新背景色避免闪烁问题。示例如下: 双缓冲: //在缓冲区作图,最后将缓冲区数据一次全部拷贝至目标DC void C 阅读全文
posted @ 2021-06-24 13:13 快雪 阅读(328) 评论(1) 推荐(0)
摘要: CWnd::SendMessage 将指定的消息发送到此窗口。 LRESULT SendMessage( UINT message, WPARAM wParam = 0, LPARAM lParam = 0); 参数 message指定要发送的消息。 wParam指定其他消息相关的信息。 lPara 阅读全文
posted @ 2021-06-22 11:39 快雪 阅读(161) 评论(0) 推荐(0)
摘要: 最近发生了一件有意思的事,MFC工程中有一个CEdit控件,控件绑定了一个double变量,当double变量的值变化时通过UpdateData可以直接展示到控件上。然后,有一个CListCtrl,需要将CEdit的值做展示。重点来了,当CEdit的值较小时,一切都很正常,当CEdit值比较大时或者 阅读全文
posted @ 2021-06-02 13:17 快雪 阅读(822) 评论(0) 推荐(0)
摘要: static void SuppressedAllConstraintAndFeature(bool bSuppress) { try { Session theSession = Session.GetSession(); UFSession theUfSession = UFSession.Ge 阅读全文
posted @ 2021-03-03 17:13 快雪 阅读(264) 评论(0) 推荐(0)
摘要: /// <summary> /// 替换组件 /// </summary> /// <param name="replacedInstance">被替换的组件实例</param> /// <param name="part">目标组件</param> static void ReplaceCompo 阅读全文
posted @ 2021-01-25 09:56 快雪 阅读(428) 评论(0) 推荐(0)
摘要: bool trim_strcmp(const char* s1, const char* s2) { if (s1 == s2) { return true; } if ((NULL == s1) || (NULL == s2)) { return false; } int s_s1 = -1; i 阅读全文
posted @ 2020-12-29 12:11 快雪 阅读(714) 评论(0) 推荐(0)
摘要: void GetAllItemData(const CTreeCtrl& tree, HTREEITEM hItem, map<HTREEITEM,DWORD_PTR>& itmData) { if (NULL == hItem) { return ; } itmData.insert(make_p 阅读全文
posted @ 2020-12-16 15:48 快雪 阅读(522) 评论(0) 推荐(0)
摘要: 最近在项目中碰到移动并旋转组件的问题,移动和旋转的输入条件是6个参数,分别是X、Y、Z轴的坐标和角度(6自由度)。例如,组件初始位置在绝对坐标系的(0,0,0)点,当输入[300,300,300,0,90,0],即将组件移动至(300,300,300)点并绕Y轴正向(所谓正向反向,遵守的是右手定则, 阅读全文
posted @ 2020-12-15 16:01 快雪 阅读(3512) 评论(1) 推荐(1)
摘要: template <typename T>//先声明模板参数 T void RemoveSameElement1(vector<T>& v) { std::unordered_set<T> existed; for (auto iter = v.begin(); iter != v.end();) 阅读全文
posted @ 2020-12-14 16:06 快雪 阅读(258) 评论(0) 推荐(0)
摘要: #include <string.h>using namespace std;string GetValue(UF_ATTR_value_p_t value) { string val; if (NULL == value) { return val; } switch (value->type) 阅读全文
posted @ 2020-09-25 17:31 快雪 阅读(583) 评论(0) 推荐(0)