摘要: 1、std::join std::join是std::thread类的成员函数之一,用于等待线程的执行完成。 #include <iostream> #include <utility> #include <thread> #include <chrono> #include <atomic> vo 阅读全文
posted @ 2023-11-24 15:11 左边的翼 阅读(322) 评论(0) 推荐(0) 编辑
摘要: 1、std::function std::function是一个模板类,其可对C++可调用的对象进行封装,比如,成员函数、静态函数等;它的基本作用是简化调用的复杂程度,归一化调用方式。 std::function<int(int, int)> int_function:声明方式为<返回值类型(参数类 阅读全文
posted @ 2023-11-24 10:24 左边的翼 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 1、类静态成员函数作为回调函数 1)类定义 CommonFunctions.h class CommonFunctions { public: CommonFunctions(); static int add_test(int a, int b); }; CommonFunctions.cpp # 阅读全文
posted @ 2023-11-23 16:19 左边的翼 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 1、定义 1)声明函数指针类型 typedef int(*CallBackFunction)(int a, int b); 2)定义函数指针对象 CallBackFunction CallBackFunction_PTR; 3)初始化函数指针对象 void set_call_back(CallBac 阅读全文
posted @ 2023-11-23 15:09 左边的翼 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 1、区域(Region)排除 1 CRect rt; 2 GetClientRect(&rt); 3 4 GraphicsPath pa; 5 pa.AddEllipse(0, 0, rt.Width(), rt.Height()); 6 Region rg(Rect(0, 0, rt.Width( 阅读全文
posted @ 2023-07-25 17:22 左边的翼 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 3、LinearGradientBrush(Rect&,Color&,Color&,LinearGradientMode) 对四种路径渐变方式进行代码效果展示,如下: 变量定义: CDC MemDCIndicator; CBitmap MemBitmapIndicator; CDC *pDC; CC 阅读全文
posted @ 2023-07-25 15:50 左边的翼 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 2、LinearGradientBrush(Rect&,Color&,Color&,REAL,BOOL),代码演示结果如下所示: 注:Rect规定画刷一次所绘制的范围,REAL值是指定颜色渐变的方向 变量定义: 1 CDC MemDCIndicator; 2 CBitmap MemBitmapInd 阅读全文
posted @ 2023-07-21 16:37 左边的翼 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 一、LinearGradientBrush构造种类 路径渐变画刷在官方文档中给出构造种类一共5中,如下所示: 1 LinearGradientBrush(Point&,Point&,Color&,Color&); 2 LinearGradientBrush(PointF&,PointF&,Color 阅读全文
posted @ 2023-07-21 14:53 左边的翼 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 一、TextureBrush构造种类 纹理画刷在官方文档中给出构造种类一共有7种,如下所示: 1 TextureBrush(Image*,WrapMode) 2 TextureBrush(Image*,WrapMode,Rect&) 3 TextureBrush(Image*,wrapMode,Re 阅读全文
posted @ 2023-07-20 16:05 左边的翼 阅读(179) 评论(0) 推荐(0) 编辑
摘要: HatchBrush在构造过程中需要指定画刷类型、前景色、后景色三项内容,其中画刷类型在官方文档中给出的枚举类型如下所示: 1 typedef enum HatchStyle { 2 HatchStyleHorizontal, 3 HatchStyleVertical, 4 HatchStyleFo 阅读全文
posted @ 2023-07-19 09:25 左边的翼 阅读(41) 评论(0) 推荐(0) 编辑