会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Atlantis
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
下一页
2023年11月27日
std::future与std::promise在C++多线程同步与数据共享中的应用
摘要: 1、std::promise与std::future std::promise与std::future通过配合使用完成数据的同步与共享,两者均是模板类;std::promise存储异步执行的值或异常;std::future提供可供访问的异步执行结果。二者配合使用伪码如下: std::promise<
阅读全文
posted @ 2023-11-27 13:48 左边的翼
阅读(204)
评论(0)
推荐(0)
2023年11月24日
std::thread方法join与detach
摘要: 1、std::join std::join是std::thread类的成员函数之一,用于等待线程的执行完成。 #include <iostream> #include <utility> #include <thread> #include <chrono> #include <atomic> vo
阅读全文
posted @ 2023-11-24 15:11 左边的翼
阅读(829)
评论(0)
推荐(0)
std::function 与 std::bind解决类成员函数作为回调函数的问题
摘要: 1、std::function std::function是一个模板类,其可对C++可调用的对象进行封装,比如,成员函数、静态函数等;它的基本作用是简化调用的复杂程度,归一化调用方式。 std::function<int(int, int)> int_function:声明方式为<返回值类型(参数类
阅读全文
posted @ 2023-11-24 10:24 左边的翼
阅读(1308)
评论(0)
推荐(0)
2023年11月23日
类成员函数作为回调函数
摘要: 1、类静态成员函数作为回调函数 1)类定义 CommonFunctions.h class CommonFunctions { public: CommonFunctions(); static int add_test(int a, int b); }; CommonFunctions.cpp #
阅读全文
posted @ 2023-11-23 16:19 左边的翼
阅读(339)
评论(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 左边的翼
阅读(28)
评论(0)
推荐(0)
2023年7月25日
GDI+区域(Region)排除与路径(GraphicsPath)叠加透明
摘要: 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 左边的翼
阅读(142)
评论(0)
推荐(0)
GDI+画刷(LinearGradientBrush(三))
摘要: 3、LinearGradientBrush(Rect&,Color&,Color&,LinearGradientMode) 对四种路径渐变方式进行代码效果展示,如下: 变量定义: CDC MemDCIndicator; CBitmap MemBitmapIndicator; CDC *pDC; CC
阅读全文
posted @ 2023-07-25 15:50 左边的翼
阅读(67)
评论(0)
推荐(0)
2023年7月21日
GDI+画刷(LinearGradientBrush(二))
摘要: 2、LinearGradientBrush(Rect&,Color&,Color&,REAL,BOOL),代码演示结果如下所示: 注:Rect规定画刷一次所绘制的范围,REAL值是指定颜色渐变的方向 变量定义: 1 CDC MemDCIndicator; 2 CBitmap MemBitmapInd
阅读全文
posted @ 2023-07-21 16:37 左边的翼
阅读(81)
评论(0)
推荐(0)
GDI+画刷(LinearGradientBrush(一))
摘要: 一、LinearGradientBrush构造种类 路径渐变画刷在官方文档中给出构造种类一共5中,如下所示: 1 LinearGradientBrush(Point&,Point&,Color&,Color&); 2 LinearGradientBrush(PointF&,PointF&,Color
阅读全文
posted @ 2023-07-21 14:53 左边的翼
阅读(676)
评论(0)
推荐(0)
2023年7月20日
GDI+画刷(TextureBrush)
摘要: 一、TextureBrush构造种类 纹理画刷在官方文档中给出构造种类一共有7种,如下所示: 1 TextureBrush(Image*,WrapMode) 2 TextureBrush(Image*,WrapMode,Rect&) 3 TextureBrush(Image*,wrapMode,Re
阅读全文
posted @ 2023-07-20 16:05 左边的翼
阅读(394)
评论(0)
推荐(0)
上一页
1
2
3
4
下一页
公告