![](https://img-blog.csdnimg.cn/e24068c0fd6c403ea5920d80610484de.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
C#
C#
笔记罐头
笔记
展开
-
C#_OpenCV使用相机
C#下通过OpenCV采集相机图像原创 2022-07-28 20:40:45 · 896 阅读 · 0 评论 -
C#_摄像头图像转换为Bitmap格式及绘制十字线
C#_摄像头图像转换为Bitmap格式及绘制十字线原创 2022-06-26 22:50:42 · 2021 阅读 · 2 评论 -
C#_导入C++的DLL并调用函数
导入:using System.Runtime.InteropServices;/*导入C++动态库*/public partial class ImportDLL{ [DllImport(@"F:\XXX\bin\x86\Debug\DVPCamera.dll", EntryPoint = "dvpGetLineRate", CallingConvention = CallingConvention.Cdecl)] public static extern dvpStatus dvpG.原创 2021-11-10 00:45:11 · 876 阅读 · 0 评论 -
C#_设置TextBox只能输入小数
/*限制输入框只能输入小数*/private void LR_Press(object sender, KeyPressEventArgs e){ //当前输入的是"."且(输入框已经有“.”或者文本框没有内容),则屏蔽输入 if (e.KeyChar == '.' && (((TextBox)sender).Text.IndexOf(".") != -1 || ((TextBox)sender).Text.Length == 0)) { e.Handled = true...原创 2021-11-10 00:36:16 · 1006 阅读 · 0 评论 -
C#_弹出提示窗口
using System.Runtime.InteropServices;/*初始化RGB增益*/float prGain = 0;float pgGain = 0;float pbGain = 0;status = DVPCamera.dvpGetRgbGain(m_handle, ref prGain,ref pgGain, ref pbGain);//获取色彩增益if(status!=dvpStatus.DVP_STATUS_OK){ MessageBox.Show("黑白相机不支.原创 2021-11-10 00:24:03 · 2886 阅读 · 0 评论 -
C#-WinForm_退出前执行语句
选择窗口/*程序退出事件*/private void CloseCamera(object sender, FormClosingEventArgs e){ dvpStatus status = DVPCamera.dvpStop(m_handle);//停止相机视频流 status = DVPCamera.dvpClose(m_handle);//关闭相机}原创 2021-11-10 00:20:50 · 691 阅读 · 0 评论 -
C#_设置combox下拉列表不可编辑
原创 2021-11-10 00:17:31 · 4026 阅读 · 0 评论 -
C#获取毫秒级时间
Console.WriteLine("发送触发信号");//记录第一次时间DateTime date1 = DateTime.Now;Console.WriteLine("触发时间: " + date1.ToString());DateTime date2 = DateTime.Now;//记录第二次时间Console.WriteLine("完成时间: " + date2.ToString());TimeSpan interval = date2 - date1;//计算间隔时间Co.原创 2021-07-03 21:15:59 · 2727 阅读 · 0 评论 -
C#判断窗口是否最大化
if(this.WindowState == FormWindowState.Maximized){ //代码}参考:https://www.douban.com/note/220657940/原创 2021-05-24 17:03:36 · 914 阅读 · 0 评论 -
C#程序打包
随便整个铁憨憨程序using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace WinFormsApp1{原创 2021-05-13 09:12:27 · 1353 阅读 · 0 评论 -
C#文本框判断是否输入回车/异常处理
/*textBox1是个输入框*/private void textBox1_TextChanged(object sender, EventArgs e){ string Char_t = textBox1.Text;//获取字符串 try { string Char_wt = Char_t.Substring(Char_t.Length - 1, 1);//获取字符串最后一位字符 if (Char_wt == "\n")//是回车键 .原创 2021-05-12 16:57:07 · 2478 阅读 · 0 评论 -
C#获取路径
/*按钮事件*/private void Path_Click(object sender, EventArgs e){ System.Windows.Forms.FolderBrowserDialog fbd = new System.Windows.Forms.FolderBrowserDialog(); if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Save_path = f.原创 2021-05-12 16:52:09 · 59 阅读 · 0 评论 -
C#_显示摄像头帧数及帧率到WinFrom窗口标题
CheckForIllegalCrossThreadCalls = false;//不捕获对错误线程的调用System.Timers.Timer t = new System.Timers.Timer(500);//定时器t.Elapsed += new System.Timers.ElapsedEventHandler(theout);//定时事件t.AutoReset = true;t.Enabled = true;/*显示帧数和帧率到窗口标题*/ public vo.原创 2021-02-27 16:57:54 · 1260 阅读 · 0 评论 -
C#_pictureBox控件随窗口大小缩放
窗体属性中添加Resize事件事件函数:private void Form1_Resize(object sender, EventArgs e) { dvpRegion roi; roi = new dvpRegion(); dvpStatus status; status = DVPCamera.dvpGetRoi(m_handle, ref roi); .原创 2021-02-26 13:59:40 · 2579 阅读 · 2 评论 -
C#_工业摄像头图像数据显示到窗口控件
需要摄像头厂商SDKusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;using DVPCameraTyp...原创 2021-02-26 10:29:37 · 949 阅读 · 0 评论