c#
sbodakes
这个作者很懒,什么都没留下…
展开
-
c# + halcon编程(读图、显示图、处理图、鼠标和图像交互)
1.halcon编写测试号算法代码部分后导出c#文件。2.vs种引用halcon安装目录下的halcondonet,工具箱中可添加控件HWindowControl。2.代码示例using Systems;using System.Theading.Tasks;using System.Windows.Forms;using HalconDotNet;namespace WindowApp{ public partial class Form1: From {原创 2021-10-08 16:46:44 · 3052 阅读 · 0 评论 -
c# - 获取屏幕分辨率、系统设置的缩放比例、rgb值
using System;using System.Windows;namespace MyApp{ public static class PrimaryScreen { #region Win32 API [DllImport("user32.dll")] public static extern IntPtr GetDC(IntPtr ptr); [DllImport("gdi32.dll").原创 2021-10-08 15:57:18 · 1413 阅读 · 0 评论 -
c++,qt, c# 统计耗时
c++代码示例#include <windows.h>#include <iostream>void main(){ LARGE_INTEGER t1,t2,tc; QueryPerformanceFrequency(&tc); QueryPerformanceCounter(&t1); func(); // 需要计时的操作 QueryPerformanceCounter(&t2); d原创 2021-10-08 15:28:11 · 408 阅读 · 0 评论 -
进程间通信(IPC)之共享内存(SharedMemory)(c++ qt c#)
1.c++进程之间#include <stdafx.h>#include <windows.h>#include <iostream>#define BUF_SIZE 4096using namespace std;void raedSharedMemCpp(){ LPVOID pBuffer; HANDLE hMap = OpenFileMapping(FILE_MAP_ALL_ACCESS,0,L"global_shared_me原创 2021-09-28 15:24:39 · 2595 阅读 · 0 评论 -
qt调用c#编写的dll
想法:1.com的方式(自定义的c# dll可以,对于手边的dll文件,不行)2.clr工程的方式(qt里面的moc直接和clr冲突,编译报错,不行)3.c#的dll + c++的clr工程dll + qt exe调用---- c#的dll编写(示例Class1.cs) ----using System;using System.Collections.Generic;using System.Linq;using System.Text; namespace Class原创 2021-09-27 11:26:52 · 1468 阅读 · 3 评论 -
c++ 调用c#dll (2种方式,步骤与示例)
1.com组件的方式---- 创建部分 ----a)创建c#的类库工程,按照com组件编写规范编写。Class1.cs文件内容如下using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Runtime.InteropServices;namespace ClassLibrary1{ public interface IMyClass原创 2021-09-27 09:17:01 · 9473 阅读 · 4 评论 -
Qt-App,MFC-App,c#-WinformApp启动控制台黑窗口
在UI程序中为了调试,打印信息,控制台程序的黑窗口很方便。1.Qt-Appvs工程属性-》链接器-》所有选项-》子系统-》控制台(/SUBSYSTEM:CONSOLE)保存,运行程序。2.MFCvs工程属性-》生成事件-》后期生成事件-》命令行editbin/SUBSYSTEM:CONSOLE "$(OUTDIR)$(TargetName)$(TargetExt)"保存,运行程序。3.c#-WinformAppvs工程属性-》应用程序-》输出类型-》控制台应用程序保.原创 2021-09-22 11:26:47 · 332 阅读 · 0 评论