上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 19 下一页

2021年1月25日

c++ freeimage 指定颜色透明

摘要: #include <iostream> #include "freeimage.h" #include "FreeImagePlus.h" int main() { const char* srcImagePath = "E:/Desktop/01.tif"; const char* dstImag 阅读全文

posted @ 2021-01-25 18:56 空明流光 阅读(324) 评论(0) 推荐(0)

c++ string 大小写转换

摘要: #include <iostream> using namespace std; #include <algorithm> string ucase(string str) { transform(str.begin(), str.end(), str.begin(), ::toupper); re 阅读全文

posted @ 2021-01-25 18:08 空明流光 阅读(716) 评论(0) 推荐(0)

opencv 裁剪图像

摘要: //读取磁盘图像文件 Mat image = imread(srcImage); //裁剪出一张新图像 Mat partImage = image(Rect(left, top, width, height)); //保存裁剪出的新图像 imwrite("d:\\a.png", partImage) 阅读全文

posted @ 2021-01-25 17:56 空明流光 阅读(2349) 评论(0) 推荐(0)

C++合并多个静态库

摘要: 转自:https://blog.csdn.net/love_hot_girl/article/details/19421363 要发布一个lib库,但是这个库用到了其他几个lib,有没有办法把他们合并成一个呢? 有的! Microsoft 库管理器实用程序 (LIB.EXE) 可用于将两个库合并为一 阅读全文

posted @ 2021-01-25 17:10 空明流光 阅读(1136) 评论(0) 推荐(0)

Base64编码

摘要: 这几天遇到一个问题,解码说base64编码不合法,于是大致了解了一下base64编码原则。 base64编码就是使用64个基本字符来表示编码以后的字符,他们分别是A~Z, a~z,0~9,+ / 但还有一个特殊字符,等号 “=”,base64 编码是将源字节中的每3个字节编码成为目标字符中的4个字符 阅读全文

posted @ 2021-01-25 14:27 空明流光 阅读(433) 评论(0) 推荐(0)

2021年1月24日

android-ndk-r21d 调用 FreeImage 实现图片格式转换

摘要: 之前用opencv转换,感觉就是高射炮打蚊子,还只支持5种图像格式,连gif都不支持。使用FreeImage,它几乎支持所有的图片格式 ImageUtility.cpp #include <jni.h> #include <iostream> using namespace std; #includ 阅读全文

posted @ 2021-01-24 11:11 空明流光 阅读(619) 评论(0) 推荐(0)

2021年1月22日

FreeImage图像格式转换

摘要: 由于opencv支持的图像格式有限,为了弥补这个不足,使用FreeImage进行格式转换。 基于磁盘文件的图像格式转换: int main() { FreeImage_Initialise(); const char* srcImagePath = "E:/Desktop/01.tif"; cons 阅读全文

posted @ 2021-01-22 17:29 空明流光 阅读(941) 评论(1) 推荐(0)

2021年1月21日

opencv 支持的图像格式

摘要: opencv原生支持以下几种图像格式: Window bitmaps - *.bmp, *.dibJPEG files - *.jpeg, *.jpg, *.jpePortable Network Graphics - *.pngPortable image format- *.pbm, *.pgm 阅读全文

posted @ 2021-01-21 16:39 空明流光 阅读(1057) 评论(0) 推荐(0)

opencv 读写图像文件

摘要: 转自:https://www.cnblogs.com/haiyang21/p/9392399.html string fname = "D:/image.jpg"; //! 以二进制流方式读取图片到内存 FILE* pFile = fopen(fname.c_str(), "rb"); fseek( 阅读全文

posted @ 2021-01-21 14:50 空明流光 阅读(247) 评论(0) 推荐(0)

opencv 图像透明

摘要: cv::Mat transparentImage; cv::cvtColor(image, transparentImage, CV_BGR2BGRA); // find all white pixel and set alpha value to zero: for (int y = 0; y < 阅读全文

posted @ 2021-01-21 13:10 空明流光 阅读(627) 评论(0) 推荐(0)

2021年1月20日

c# 异步事件

摘要: public event EventHandler ProgressChanged; private void RaiseProgressChangedEvent() { if (this.ProgressChanged != null) { var delegateArray = this.Pro 阅读全文

posted @ 2021-01-20 15:46 空明流光 阅读(471) 评论(0) 推荐(0)

2021年1月19日

c++读写文件

摘要: 读取文件: #include <stdio.h> void read() { FILE* f = fopen("E:/Desktop/1.jpg", "rb"); fseek(f, 0, SEEK_END); long size = ftell(f); rewind(f); unsigned cha 阅读全文

posted @ 2021-01-19 14:20 空明流光 阅读(145) 评论(0) 推荐(0)

2021年1月13日

opencv 图像格式转换

摘要: extern "C" _declspec(dllexport) BYTE* __stdcall ImageConvert(BYTE* imageData, int imageDataSize, const char* format, int* returnSize) { vector<uchar> 阅读全文

posted @ 2021-01-13 13:11 空明流光 阅读(791) 评论(0) 推荐(0)

2021年1月11日

jna传递byte数组

摘要: C++代码: #include "stdafx.h" #include <iostream> using namespace std; extern "C" _declspec(dllexport) int __stdcall Add(int a, int b) { return a + b; } 阅读全文

posted @ 2021-01-11 16:18 空明流光 阅读(2491) 评论(2) 推荐(0)

2021年1月5日

C#空传播运算符

摘要: string a = null; Console.WriteLine( a?.ToString()?.ToString()); return; string[] b = null; Console.WriteLine( b?[0].Substring(0,1)); return ; 以上两段代码分别 阅读全文

posted @ 2021-01-05 16:17 空明流光 阅读(229) 评论(0) 推荐(0)

2020年12月17日

C# 批量替换文本文件里的内容

摘要: void Main() { var result = replaceFiles(@"C:\Users\admin\Desktop\opencv31\opencv\mybuild", "*.*", @"C:\Users\admin\Desktop\opencv31\opencv\mybuild", ' 阅读全文

posted @ 2020-12-17 18:13 空明流光 阅读(2656) 评论(0) 推荐(0)

C#不区分大小写的字符串替换

摘要: 这个问题确实并不简单,写过的人才知道,需要克服的点很多。微软为了我们提供了一个正则方法,但需要注意陷阱,以下代码演示了其中的陷阱。 void Main() { Regex.Replace("abc.+efg", ".+", "cd", RegexOptions.IgnoreCase).Dump(); 阅读全文

posted @ 2020-12-17 14:15 空明流光 阅读(373) 评论(0) 推荐(0)

2020年12月13日

C# socket 请求转发

摘要: 服务端: void Main() { Socket socketA = null; Socket socketB = null; var maxWaitingRequest = 10; var localSocket = new Socket(AddressFamily.InterNetwork, 阅读全文

posted @ 2020-12-13 11:58 空明流光 阅读(873) 评论(0) 推荐(0)

2020年12月12日

C# Socket 端口复用

摘要: 转载:https://www.cnblogs.com/wzd24/archive/2007/05/22/755016.html 不过原作者少定了一句代码,导致本人调试了半天也成功不了 在winsock的实现中,对于服务器的绑定是可以多重绑定的,在确定多重绑定使用谁的时候,根据一条原则是谁的指定最明确 阅读全文

posted @ 2020-12-12 12:38 空明流光 阅读(892) 评论(0) 推荐(0)

2020年12月10日

C# socket TCP 通信

摘要: Server: void Main() { var maxWaitingRequest = 10; var localSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); local 阅读全文

posted @ 2020-12-10 16:21 空明流光 阅读(319) 评论(0) 推荐(0)

2020年12月9日

C#端口转发

摘要: 转载自:https://www.jb51.net/article/62638.htm 太优秀的示例代码,转载了 using System; using System.Net.Sockets; using System.Threading; namespace PortTransponder { cl 阅读全文

posted @ 2020-12-09 17:06 空明流光 阅读(2236) 评论(0) 推荐(0)

C# 获取windows下端口占用与进程名称

摘要: void Main() { GetNetStatPorts().OrderBy(item=> int.Parse(item.port_number)) .Where(item=>item.name.StartsWith("LINQPad.UserQuery")).Dump(); } // // Th 阅读全文

posted @ 2020-12-09 14:00 空明流光 阅读(1488) 评论(1) 推荐(0)

2020年12月7日

C++ 读取文件资源

摘要: 在VS中加入一个资源文件,类型名为"FILE",分类为IDR_FILE_STARTER,默认是中文 读取方式如下: HRSRC hRes = FindResourceExW(NULL, TEXT("FILE"), MAKEINTRESOURCE(IDR_FILE_STARTER),2052); if 阅读全文

posted @ 2020-12-07 16:20 空明流光 阅读(867) 评论(0) 推荐(0)

2020年12月6日

c++ int 与 byte array 互转

摘要: int to byte array #include <vector> using namespace std; vector<unsigned char> intToBytes(int paramInt) { vector<unsigned char> arrayOfByte(4); for (i 阅读全文

posted @ 2020-12-06 14:24 空明流光 阅读(1827) 评论(0) 推荐(0)

2020年12月5日

C++ 枚举资源

摘要: // ResourceManager.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <Windows.h> #include <atlconv.h> #define LANGUAGEID 1033 char deadCode[] = "0x 阅读全文

posted @ 2020-12-05 21:58 空明流光 阅读(188) 评论(0) 推荐(0)

c++ 写入并读取资源文件

摘要: // ResourceManager.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <Windows.h> #include <atlconv.h> #define LANGUAGEID 1033 HANDLE hUpdate; char 阅读全文

posted @ 2020-12-05 20:11 空明流光 阅读(844) 评论(0) 推荐(0)

2020年12月3日

Visual GDB 无代码提示

摘要: 打开项目属性 Visual GDB Project Properties 1. IntelliSense Directories 选项卡,如果有下载标志,都点一下,把Linux的include项同步到本地 2. IntelliSense Settings 选项卡,切换一下 IntelliSense 阅读全文

posted @ 2020-12-03 16:44 空明流光 阅读(225) 评论(0) 推荐(0)

开源许可证GPL、BSD、MIT、Mozilla、Apache和LGPL的区别(转)

摘要: 阅读全文

posted @ 2020-12-03 14:56 空明流光 阅读(113) 评论(0) 推荐(0)

eclipse 中使用 svn

摘要: 在eclipse中使用subclipse 下载与安装 在subclipse的官方网站http://subclipse.tigris.org/上找到eclipse中对应的URL:http://subclipse.tigris.org/update_1.12.x,然后在eclipse中安装即可。连接sv 阅读全文

posted @ 2020-12-03 12:54 空明流光 阅读(336) 评论(0) 推荐(0)

linux centos 7.5 开启 postgresql 远程访问

摘要: 如果是随操作系统安装的,则需要先初始化 postgresql: 1.初始化数据库; yum install postgres*postgresql-setup initdb2.启动postgresql并设置为开机自启动;systemctl restart postgresqlsystemctl en 阅读全文

posted @ 2020-12-03 10:46 空明流光 阅读(935) 评论(0) 推荐(0)

linux centos 7 开启 ftp

摘要: centos开启ftp服务的步骤 1、安装vsftpd sudo yum install vsftpd -y 2、启动ftp服务 service vsftpd start 3、 加入开机启动 chkconfig vsftpd on netstat -nltp | grep 21 可以查看系统监听21 阅读全文

posted @ 2020-12-03 10:03 空明流光 阅读(1044) 评论(0) 推荐(0)

2020年12月2日

CentOS 7.5 改IP后不生效无法上网解决办法

摘要: 通过Cent桌面修改了IP地址,看似生效了,但就是上不了网,网关也不通。重启系统也不行。 vi /etc/sysconfig/network-scripts/ifcfg-eth0 将eth0网卡的ONBOOT=no修改为ONBOOT=yes 这个配置默认好像就是yes 将BOOTPROTO=no修改 阅读全文

posted @ 2020-12-02 16:32 空明流光 阅读(1067) 评论(0) 推荐(0)

2020年11月25日

Windows Server 2008R2 及上系统安装 Windows 可选功能

摘要: 1. 获取有哪些可选功能可以安装 Dism /online /Get-Features >c:\features.txt 或 Dism /Online /Get-Features /Format:Table 2. 查看某一个可选功能的详细信息 Dism /online /Get-FeatureInf 阅读全文

posted @ 2020-11-25 13:44 空明流光 阅读(284) 评论(0) 推荐(0)

2020年11月20日

C#只允许运行一个实例

摘要: var preInstance = Process.GetProcesses().FirstOrDefault(p => { try { if (p.Id != Process.GetCurrentProcess().Id && p.MainModule != null && p.MainModul 阅读全文

posted @ 2020-11-20 09:38 空明流光 阅读(233) 评论(0) 推荐(0)

2020年11月19日

C# 命令行参数分割

摘要: [DllImport("shell32.dll", SetLastError = true)] private static extern IntPtr CommandLineToArgvW([MarshalAs(UnmanagedType.LPWStr)] string lpCmdLine, ou 阅读全文

posted @ 2020-11-19 15:29 空明流光 阅读(346) 评论(0) 推荐(0)

C# 获取所有已登录系统的用户名

摘要: [DllImport("wtsapi32.dll")] static extern IntPtr WTSOpenServer([MarshalAs(UnmanagedType.LPStr)] string pServerName); [DllImport("wtsapi32.dll")] stati 阅读全文

posted @ 2020-11-19 15:02 空明流光 阅读(1446) 评论(0) 推荐(0)

C#获取进程用户名

摘要: void Main() { Process.GetCurrentProcess().Id.Dump(); getProcessOwnerName(Process.GetCurrentProcess().Id).Dump(); } public string getProcessOwnerName(i 阅读全文

posted @ 2020-11-19 10:39 空明流光 阅读(833) 评论(0) 推荐(0)

2020年11月18日

psexec 用法

摘要: 自动同意使用协议、用SYSTEM帐号、异步的、桌面交互 启动 notepad.exe psexec -accepteula -s -d -i notepad.exe 阅读全文

posted @ 2020-11-18 22:12 空明流光 阅读(234) 评论(0) 推荐(0)

2020年11月17日

检测 Visual C++ Redistributable Package 相应版本是否已安装

摘要: 检测注册表 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\{vs-version}\VC\Runtimes\{platform}\Installed, 值为1即代表已安装 {vs-version} :VS版本号,vs2017对应为14,其它版本 阅读全文

posted @ 2020-11-17 15:52 空明流光 阅读(1891) 评论(0) 推荐(0)

2020年11月13日

c# 创建快捷方式

摘要: 之前网上找了几个方法,创建快捷方式,到windows 7 下竟然报错,或没有权限,今天经过一番搜索,终于找到一个很简单的方法: 首先添加以下引用:COM下Windows Script Host Object Model using System; using System.Collections.G 阅读全文

posted @ 2020-11-13 09:40 空明流光 阅读(257) 评论(0) 推荐(0)

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 19 下一页

导航