C++
Up to the mountain
用爱发电,独一无二的原创解决方案
展开
-
为DuiLib的Edit控件增加PlaceHolderText
效果:没有焦点时显示一个提示文本,获得焦点时则清空提示,开始输入。原创 2023-09-30 15:12:17 · 189 阅读 · 0 评论 -
ffmpeg采集摄像头保存为h264裸流文件,可以用potplayer、VLC播放
网上根本没这方面的代码,要不就是opencv的,要不就是保存yuv的,或者mp4/avi的,不多说了,直接上代码,懒:)#include <iostream>using namespace std;#include <cstdlib>#include <cstdio>#include <string>#include <Windows.h>#include <thread>#include <mutex>..原创 2020-11-06 16:02:15 · 3120 阅读 · 1 评论 -
ffmpeg采集摄像头,h264压缩,保存为mp4文件
接上篇:ffmpeg采集摄像头保存为h264裸流文件,可以用potplayer、VLC播放我们更进一步,保存为更通用的mp4文件#define CODEC_FLAG_GLOBAL_HEADER (1 << 22)static void encodeMP4(AVCodecContext* enc_ctx, AVFormatContext* inFmtCtx, AVFormatContext* outFmtCtx, AVFrame* frame,原创 2020-11-12 16:55:28 · 5372 阅读 · 1 评论 -
Qt Windows高清DPI自适应分辨率缩放,比较完美的解决方案
我们知道,从win7系统开始,点击桌面右键,显示设置中有个缩放方案,可以缩放文本、应用的界面和文字。如果我们选择缩放后,你会发现大部分程序可以比较完美的缩放,但是你的QT程序显示效果却和多数程序不一致,不是程序界面太大,就是文字比例不对,或者这样那样的显示问题,无论怎么调节,均感觉不正常,原因何在?经过一番研究,结论如下:...原创 2020-04-30 15:42:07 · 29780 阅读 · 39 评论 -
获取本机安装的所有软件列表、获取所有安装的浏览器列表
struct TInstalledSoftwareItem{ QString displayName, installPath;};class TInstalledSoftwareList: public QVector<TInstalledSoftwareItem>{public: bool contains(const QString& name) { for (auto& item: *this) { if (item.display...原创 2021-03-17 11:59:31 · 1353 阅读 · 0 评论 -
最好的C++ html parser解析器,pugixml修改过的pugihtml,轻量、完善、功能强大
轻量、使用简单,不需要编译lib,完善、功能强大,支持复杂标签搬运:https://github.com/rofldev/pugihtml用法: pugihtml::html_document doc; bool b = doc.load(docFile); if (b) { auto p = doc.child("P"); for (auto node = p.child("A"); node; n...原创 2020-11-06 16:24:45 · 765 阅读 · 0 评论