- 博客(40)
- 资源 (4)
- 收藏
- 关注
原创 WPF:带阴影、带箭头的Popup提示框
WPF:带阴影、带箭头的Popup提示框效果图实现思路下载地址参考连接效果图实现思路首先感谢参考连接1的作者提供的思路开始打算使用Border+三角形的方法来实现提示框,但是最后发现走不通,因为阴影会被遮挡学习了一下WPF中的Path的绘制方法参考1+参考3最后总结了一下阴影部分的实现方法下载地址Demo参考连接1.使用Popup制作带箭头的弹出提示框2.自定义带尖括号和阴影的Popup框3.WPF中图形表示语法详解...
2021-03-30 17:19:14
957
原创 【FFMPEG】"width / height not divisible by 2" 解决方法
出现该错误的原因是在于:视频的宽度必须是32的倍数,高度必须是2的倍数解决方法: if (screen_width % 32 != 0) { screen_width = screen_width / 32 * 32; } if (screen_height % 2 != 0) { screen_height = screen_height / 2 * 2; }...
2018-07-05 16:58:07
7703
1
原创 【FFMPEG】打印 av_log 的输出
在使用FFMPEG库的时候,如果有使用上的错误,FFMPEG 通过av_log 可以打印相应的消息到标准输出里。但有时候我们并没有标准输出,那么这个时候应该怎么处理呢? 方法:使用 av_log_set_callback 获取 av_log的打印输出。 示例如下:void Init(){ ... av_log_set_callback(&FFMPEG_Callba...
2018-07-05 16:50:01
2787
原创 【FFmpeg】 图像缩放
在用FFmpeg时遇到需要将截屏的图像(1920*1080)转换为 1024*768的问题。//截屏的编码上下文 //假设这里视频截图分辨率为1920*1080AVCodecContext *pVideoCodecCtx = m_pVideoFormatCtx->streams[nVideoIndex]->codec;......//输出的编码上下文AVCodecConte...
2018-04-10 14:43:28
2526
原创 数据结构和算法【C语言】---单链表
#include #include typedef struct node{ int data; struct node *pNext;}Node, *PNODE, *List;PNODE CreateNode(int data){ PNODE pNew = (Node *)malloc(sizeof(Node)); pNew->data = data; pNew->pN
2018-02-06 09:40:12
234
原创 GitHub 配置详解
http://www.udpwork.com/item/11473.htmlhttp://www.7down.com/article/86528.html
2016-11-03 10:10:44
327
原创 C#+IM+agsXMPP
参考网站:1.管理软件IM开发www.cnblogs.com/cbi360/archive/2013/05/28/3103041.html
2014-11-14 17:17:18
7186
原创 【练习】有两个文件context.txt和words.conf,请尝试将他们合并成为一段文字,
有两个文件context.txt和words.conf,请尝试将他们合并成为一段文字,并打印出来。这两个文件内容如下:context.txt“并不是每个人都需要$(qunar)自己的粮食,$(flight.1)每个人都需要做自己穿的$(flight.2),我们说着别人发明的$(hotel),使用别人发明的数学......我们一直在$(tuan)别人的成果。使用人类的已有经验
2014-10-27 14:31:08
730
原创 HipHop php :PhP 转 C++
使用资料: 1.http://slaytanic.blog.51cto.com/2057708/962503/
2014-10-11 11:53:26
944
原创 【C++】链表学习
#include "stdafx.h"#include using namespace std;typedef struct Node{ int nVal; Node *pNext;}Link,*pLink;Link * CreateLink(int arr[], int n){ if (0 == n) { return NULL;
2014-08-19 10:14:36
604
原创 SYSTEMTIME 与 time_t 互转函数
time_t SystemTimeToTime_t( const SYSTEMTIME& st ){ tm temptm = {st.wSecond, st.wMinute, st.wHour, st.wDay, st.wMonth - 1, st.wYear - 1900, st
2014-04-29 14:47:40
2975
原创 【C++】查询、创建、设置注册表键值的示例代码
示例代码将在注册表位置:HKEY_CURRENT_USER\Software\ 读写键值bool LicenseManage::OpenRegKey(HKEY& hRetKey){ if (ERROR_SUCCESS == RegOpenKey(HKEY_CURRENT_USER,"Software", &hRetKey)) { return true;
2014-04-29 14:44:36
5962
原创 【C++】封装使用jsoncpp的类
封装使用jsoncpp的类包括5种功能1.是否存在节点 bool IsNodeExisted(string jsonObj, string strNode); 2.为数组增加元素 int AppendArrayObject(string& jsonObj, string strNode, string strValue);3.获取节点值 int
2014-02-26 18:29:34
5521
转载 [OpenSSL]编译过程
【1】方式1 vc2008命令行编译 先下载ActivePerl,下载最新版本(现在是最新),文件名为ActivePerl-5.14.2.1402-MSWin32-x86-295342.msi。安装。 下载openssl-1.0.1c,解压到C盘根目录下。 接下来是下载Microsoft Visual C++ 2008 Redistributable,该软件有些人需要
2014-01-02 14:55:12
790
原创 【MFC】按钮点击拷贝到剪切板
void CXX::OnBnClickedCopyButton(){ CString strSource; GetDlgItemText(IDC_DISPLAY_EDIT,strSource); if(OpenClipboard()) { HGLOBAL hClip; TCHAR* pBuffer; E
2013-12-23 15:54:13
880
原创 【笔试题】整理一
1.struct mybitfields { unsigned short a : 4; unsigned short b : 5; unsigned short c : 7; }testvoid main(void) { int i; test.a=2; test.b=3; test.c=0;i=*((short *)&test)
2013-12-13 14:32:05
660
原创 【算法】求二进制中1的个数
//除法int Count(int src){ int nNum = 0; while (src) { if (src % 2 == 1) { nNum++; } src /= 2; } return nNum;}//右移int Count1(int src)
2013-12-11 10:21:21
592
原创 【算法】给定正数N,求N的阶乘N!的末位有多少个0
int Factorial(int N){ int nNum = 0; while (N) { if (N%5 == 0) { nNum++; } N--; } return nNum;}理由是:由于只有2*5才可能出现末尾为0的情况,所以只需要考虑2和5的个数就可以
2013-12-11 10:10:42
740
原创 【C++】顺序容器 Vector 注意事项
引用头文件#include 一、操作数据主要有下列几种方式: vector vecSalary; //1.直接添加 vecSalary.push_back(2000); vecSalary.push_back(3000); //2.按位置添加 vecSalary.insert(vecSalary.begin(), 1000);
2013-05-17 18:00:43
2599
原创 【C++】容器元素的复制和变换
一、复制容器元素:copy()算法copy()的原形如下: template OutputIterator copy( InputIterator _First, //源容器起始位置 InputIterator _Last, //源容器终止位置 OutputIterator _DestBeg //目标容器的起始位置 );列子:将两张成绩表统计到一起,形成一张成绩总表
2013-05-17 17:49:09
4128
原创 【MFC】将有分隔符的字符串(string/CString)转化为int
例如:字符串为如下所示,是带有某些分隔符的如‘-’。下面的情况是需要将其转化为唯一的int值,采用偏移的方式CString 转化后的 int100 100100-10 100100-10-2 ((100代码如下:#include using namespace std;int fun(const char
2013-05-15 19:58:26
1574
原创 【MFC】VC调用WinRar解压文件(如:.gz)
void UnpackFile(const CString & strFilePath){ CString winRarInstallPath = "C:\\Program Files\\WinRAR\\WinRAR.exe"; CString strDestPath; //目标解压位置 int pos = strFilePath.ReverseFind('.');
2013-04-27 17:36:23
4552
转载 【MFC】VC 删除目录和文件
static void DeleteDirectories(CString csPath){ CFileFind finder; CString tempPath; tempPath.Format("%s%s", csPath, "//*.*"); BOOL bWork = finder.FindFile(tempPath); while(bWork) { bWork =
2013-04-27 17:20:19
1865
原创 【MFC】解析二进制时,十进制显示为十六进制的数方法
// char abParam[6] CString tmp; LPTSTR p; TCHAR szText[300]; ZeroMemory(szText, 300); p = szText; int nLength = sizeof(it->second->abPa
2013-04-23 10:11:55
926
原创 【随笔】32位RGB转换为16位的RGB,优化%
gameloft 有道笔试题是这样的:有32位的RGB色彩,保存方式如下:RED = 0X00FF0000; GREEN = 0X0000FF00; BULE= 0X000000FF;实现一个函数将此32位RGB转换为16位的RGB色彩,其中(REG, GREEN, BLUE) 分别为( 5, 6, 5)另外:对于色彩一般是舍弃低位保留高位。unsign
2013-04-21 14:17:04
5346
原创 【MFC】BROWSEINFO 设置路径并显示,默认引导至源路径
void CTestDlg::SetFolderPath(UINT uid){ BROWSEINFO bi; char szPath[MAX_PATH]; LPITEMIDLIST pList = NULL; ZeroMemory(szPath, MAX_PATH); //获取当前路径 GetDlgI
2013-04-16 17:18:26
11606
原创 【MFC】VC读写ini文件
可以用于加载时,读取上一次的纪录。一:写ini配置文件: //获取exe路径 CString strPath; GetModuleFileName(NULL,strPath.GetBufferSetLength(MAX_PATH+1),MAX_PATH); strPath.ReleaseBuffer(); int nPos =
2013-04-16 15:53:44
4651
原创 【MFC】CDateTimeCtrl 空间设置默认日期和时间
控件默认是获取当前的日期和时间的,当需要设置默认日期时间的时候,可以如下操作:// 绑定空间的成员: CDateTimeCtrl m_dateBegin; //日期 CDateTimeCtrl m_timeBegin;//时间 COleDateTime currOleDate; m_dateEnd.GetTime(currOleDate); CO
2013-04-16 15:41:33
10968
原创 VAssistX 函数注释和文件头注释模板
VAssistX->Insert VA Snippet->Eidt VA Snippets->Refactor Document Method函数模板/*************************************************// Method: $SymbolName$// Description: // Author:
2013-04-01 18:11:00
6320
转载 【C++】字符串模糊匹配
原文出处:http://www.cnblogs.com/Creator/archive/2013/03/25/2981186.html需求: 准入授权配置文件有时候分了好几个维度进行配置,例如 company|product|sys这种格式的配置:1.配置 "sina|weibo|pusher" 表示 sina公司weibo产品pusher系统能够准入,而"sina|weibo|si
2013-03-27 14:04:09
1523
原创 【MFC】修改过的Excel处理类
1. 导入MFC Lib库中的 CApplication、CRange、CWorkBook、CWorkBooks、CWorkSheet、CWorkSheets2. 将以上所有的h文件中的 #import 行 注释 并添加#include 例如: //#import "C:\\Program Files\\Microsoft Office\\Office12\\EXCEL.EXE" n
2013-03-19 15:53:24
5773
4
原创 【MFC】使用不同字符集显示不同外观的界面
今天遇到一个问题是程序默认为 Unicode 编码方式,这样需要定义成CString a = L“”。网上处理这个的方法是 解决方案文件属性->配置属性->常规->字符集 ,选择“使用多字节字符集”但这样就出现了界面显示风格和默认设置的不一致解决办法是 stdafx.h中按红色注释掉条件编译//#ifdef _UNICODE#if defined _M_IX86#pr
2013-03-04 16:28:23
1592
原创 【C++】函数传参
1.指针参数#include "stdafx.h"#include using namespace std;char * a = new char[20];void test(char * pArr){ cout<<&pArr<<endl; a = "hello"; pArr = a; cout<<pArr<<endl;}
2013-01-30 16:14:06
489
原创 检查工具相关
1.Visual Leak DetectorC++轻量级检查工具http://www.codeproject.com/Articles/9815/Visual-Leak-Detector-Enhanced-Memory-Leak-Detectio2.ANTS Memory Profiler.NET程序内存分析的工具http://www.red-gate.com/products
2013-01-24 10:41:45
492
原创 【C++】删除顺序容器(如:vector)中的重复字符串
#include #include #include #include using namespace std;int main(int argc, const char * argv[]) { stringstream sentence("the quick red fox jumps over the slow red turtle");
2013-01-16 17:25:03
2298
原创 脚本编译相关(VS、cygwin)
一:VS(以vs2010为例) 创建txt文档,修改为 xx.bat; 内容如下: set VS_DEV="%VS100COMNTOOLS%..\IDE\devenv.com" set srcPath=D:\DTC\DTr\trunk\04code\ %VS_DEV% %srcPath%/Oprofile.sln /Rebuild "
2012-12-25 11:04:21
1005
转载 【C++】stringToInt intToString
#include #include using namespace std;int main(){ // intToString stringstream ss; int num = 123456; ss << num; string s = ss.str(); if (!ss.good()) { //error }
2012-12-18 15:27:35
3200
原创 【C++】读写文件
#include #include using namespace std;int main(){ // 读文件, 保存至fileContent中 string openFile = "C:\\1.txt"; ifstream inf; inf.open(openFile.c_str(), ios::in); string lineConten
2012-12-18 14:55:11
522
原创 【C++】关于sort()的使用
头文件:#include 例子如下:#include #include #include using namespace std;int main(){ string a[] = {"123", "124","112","102","111"}; sort(a, a+5); for (int i = 0; i < 5; i++)
2012-12-18 14:19:41
509
转载 vs2010 快捷键设置问题 alt+ F8
具体修改方法如下:工具-选项-环境-键盘-应用以下其他键盘映射方案,选择visual C++6,然后编代码试试,嘿,我的alt+F8回来了(否则是ctrl + k, ctrl + f);
2012-12-03 14:46:08
3021
动态链接库DLL的使用Demo
2013-08-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人