随笔分类 -  C/C++

摘要:遇到个需要将两个std::tuple对应元素分别求平均值的需求 实现 #include <iostream> #include <tuple> template <typename T, size_t S = 0, size_t E = std::tuple_size<T>::value> void 阅读全文
posted @ 2022-11-24 13:16 WindSnowLi 阅读(54) 评论(0) 推荐(0) 编辑
摘要:uchar *bits = nullptr; void initBuff(size_t size) { if (bits == nullptr) { bits = new uchar[size]; } } void releaseBuff() { if (bits != nullptr) { del 阅读全文
posted @ 2022-11-19 18:39 WindSnowLi 阅读(53) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/qq_44575789/article/details/127935697像素处理太慢,这里换种方式 #pragma once #include <QDebug> #include <QImage> #include <QTimer> #include < 阅读全文
posted @ 2022-11-19 18:26 WindSnowLi 阅读(18) 评论(0) 推荐(0) 编辑
摘要:创建并获取窗口句柄 view->show(); view->createWinId(); auto wid = view->winId(); 获取图片 // 三秒钟之后 QTimer::singleShot(3000, [wid]() { auto&& image = GetGDIBitmap((H 阅读全文
posted @ 2022-11-19 13:19 WindSnowLi 阅读(286) 评论(0) 推荐(0) 编辑
摘要:代码示例 https://download.csdn.net/download/qq_44575789/86993010 CToolBar类 实现 加载位图的成员变量 CToolBar m_ToolBar; CBitmap m_bitmapEmpty; CBitmap m_bitmap1; CBit 阅读全文
posted @ 2022-11-13 16:12 WindSnowLi 阅读(230) 评论(0) 推荐(0) 编辑
摘要:解决方法 将单例对象初始化放入.cpp文件 示例 Fun.h #ifdef FUN_EXPORTS #define FUN_API __declspec(dllexport) #else #define FUN_API __declspec(dllimport) #endif #include <i 阅读全文
posted @ 2022-11-01 11:26 WindSnowLi 阅读(71) 评论(0) 推荐(0) 编辑
摘要:核心部分 识别文本编码,这里使用ICU 核心代码 /// <summary> /// 读取文本文件内容并返回QString /// </summary> /// <param name="path">文件路径</param> /// <returns>文本内容</returns> static QS 阅读全文
posted @ 2022-09-20 09:52 WindSnowLi 阅读(44) 评论(0) 推荐(0) 编辑
摘要:示例代码 #include <string> #include <iostream> // 导入format #include <format> struct Vector4D { int x, y, z, s; }; // std::formatter格式化Vector4D namespace s 阅读全文
posted @ 2022-08-10 18:02 WindSnowLi 阅读(287) 评论(0) 推荐(0) 编辑
摘要:效果 头文件GrayVirsual.h #pragma once #include <QtWidgets/QMainWindow> #include <QVTKOpenGLNativeWidget.h> #include <opencv2/core/core.hpp> #include <openc 阅读全文
posted @ 2022-07-21 22:10 WindSnowLi 阅读(91) 评论(0) 推荐(0) 编辑
摘要:效果 子窗口头文件ViewWidget3D.h #pragma once #include <QMainWindow> #include <QVTKOpenGLNativeWidget.h> #include <vtkActor.h> #include <vtkCamera.h> #include 阅读全文
posted @ 2022-07-13 08:33 WindSnowLi 阅读(290) 评论(0) 推荐(0) 编辑
摘要:子程序主要代码 #include "ChildWidgets.h" #include <QtWidgets/QApplication> #include <QWindow> #include <iostream> #include <QMessageBox> #include <thread> in 阅读全文
posted @ 2022-06-27 16:17 WindSnowLi 阅读(95) 评论(0) 推荐(0) 编辑
摘要:主要参考 https://blog.csdn.net/qq_37996632/article/details/106415402 https://kitware.github.io/vtk-examples/site/Cxx/Qt/BorderWidgetQt 主要代码 #include "Bord 阅读全文
posted @ 2022-06-21 11:17 WindSnowLi 阅读(199) 评论(0) 推荐(0) 编辑
摘要:1. 创建C#类库项目 2. 设置项目属性 3. 添加接口以及类源代码 using System; using System.Runtime.InteropServices; namespace AddCom { [Guid("8F5710FD-528A-4474-A673-47717F93EA88 阅读全文
posted @ 2022-06-07 15:54 WindSnowLi 阅读(38) 评论(0) 推荐(0) 编辑
摘要:官方示例 https://github.com/edenhill/librdkafka/blob/master/examples/rdkafka_example.cpp 生产者 #include <iostream> #include <string> #include <cstdlib> #inc 阅读全文
posted @ 2022-05-18 11:32 WindSnowLi 阅读(310) 评论(0) 推荐(0) 编辑
摘要:关键代码 #include "mainwindow.h" #include "ui_mainwindow.h" #include <QToolBar> #include <QMessageBox> class QMenuBar; class QToolBar; MainWindow::MainWin 阅读全文
posted @ 2022-05-17 00:22 WindSnowLi 阅读(195) 评论(0) 推荐(0) 编辑
摘要:原文 头文件定义 #pragma once #include "framework.h" #include <map> #include <tuple> class CScaleWnd : public CDialogEx { public: // 标准构造函数 CScaleWnd(); CScal 阅读全文
posted @ 2022-03-15 15:53 WindSnowLi 阅读(92) 评论(0) 推荐(0) 编辑
摘要:原文 实现与测试 #include <vector> #include <string_view> #include <iostream> using namespace std; std::vector<std::string_view> Split(std::string_view sv, ch 阅读全文
posted @ 2022-03-15 08:57 WindSnowLi 阅读(77) 评论(0) 推荐(0) 编辑
摘要:原文 实现XDLine.hpp #pragma once #include <vector> #include <tuple> #include <algorithm> #include <cmath> namespace DDMath { /** * @brief 最小二乘法,根据三维坐标拟合出一 阅读全文
posted @ 2022-03-15 08:45 WindSnowLi 阅读(184) 评论(0) 推荐(0) 编辑
摘要:首发 一个简单的OpenGL显示十字坐标系小示例 源码地址:https://github.com/WindSnowLi/XDAxis 主要函数声明 #pragma once #include "QExpandOpenGLWidget.h" class XDAxis : public QExpandO 阅读全文
posted @ 2022-03-14 23:55 WindSnowLi 阅读(67) 评论(0) 推荐(0) 编辑
摘要:又有了新思路,复用线程 ThreadPool.hpp #pragma once #include <thread> #include <memory> #include <functional> #include <utility> #include <condition_variable> #in 阅读全文
posted @ 2022-02-21 23:06 WindSnowLi 阅读(23) 评论(0) 推荐(0) 编辑

more_horiz
keyboard_arrow_up dark_mode palette
选择主题
点击右上角即可分享
微信分享提示