资源简介
使用STM32搭配OV7670采集图像,并将图像通过串口上传到上位机,上位机接受数据并处理数据,最终显示彩色图像

代码片段和文件信息
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;
using System.IO.Ports;
using System.IO;
namespace image
{
public partial class Form1 : Form
{
#region 全局变量
int bmp_width = 240; //定义接收数据的宽度
int bmp_height = 320; //定义接受图片的高度
Bitmap bmp; //定义一个bmp变量用于显示与储存图片
int hang = 0 lie = 0; //用于写入图像时的行列指针
//串口发送回的数据以8为为依据将rgb565拆分成2个字节发送故需要以下变量
bool isheight = true; //判断是否为高位的标志位true表示当前数据为高位数据
int heightdate = 0; //用于存储高8位的储存单元
bool pic_MoveFlag = false; //pic移动的标志位
int pic_xPos = 0; //鼠标移动的偏移量
int pic_yPos = 0;
string SelectPath = ““;
int orderID = 1;
#endregion
///
/// 窗口初始化
///
public Form1()
{
InitializeComponent();
}
private void ShowDebug(string str)
{
try
{
int MaxLength = 14;
int lines = (str.Length / MaxLength) + 1;
textBox1.Text += DateTime.Now.ToString(orderID.ToString(“000“) + “·[yy-MM-dd HH:mm:ss]:\r\n“);
orderID++;
for (int i = 0; i < lines; i++)
{
if (i == lines - 1)
{
textBox1.Text += “- “
+ str.Substring(i * MaxLength str.Length % MaxLength)
+ “\r\n“;
}
else
{
textBox1.Text += “- “
+ str.Substring(i * MaxLength MaxLength) + “\r\n“;
}
}
textBox1.Text += “\r\n\r\n“;
}
catch { }
}
///
/// 窗口UI初始化调用
///
///
///
private void Form1_Load(object sender EventArgs e)
{
button1_Click(null null); //更新串口号
comboBox2.SelectedIndex = 4; //选中默认波特率
ShowDebug(“系统开始运行。“);
bmp = new Bitmap(bmp_height bmp_width);
}
///
/// 更新按键按下可自动查找可用串口
///
///
///
private void button1_Click(object sender EventArgs e)
{
comboBox1.Items.Clear();
for (int i = 0; i < 30; i++)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 187 2018-07-03 23:00 (2017.09.16)串口图像上位机\image\App.config
文件 158208 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\bin\Debug\image.exe
文件 187 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\bin\Debug\image.exe.config
文件 46592 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\bin\Debug\image.pdb
文件 23168 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\bin\Debug\image.vshost.exe
文件 187 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\bin\Debug\image.vshost.exe.config
文件 490 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\bin\Debug\image.vshost.exe.manifest
文件 67646 2018-07-03 23:00 (2017.09.16)串口图像上位机\image\Demo.ico
文件 17792 2018-07-03 23:00 (2017.09.16)串口图像上位机\image\Form1.cs
文件 17951 2018-07-03 23:00 (2017.09.16)串口图像上位机\image\Form1.Designer.cs
文件 107997 2018-07-03 23:00 (2017.09.16)串口图像上位机\image\Form1.resx
文件 3945 2018-07-03 23:00 (2017.09.16)串口图像上位机\image\image.csproj
文件 1609 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7087 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 3068 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\obj\Debug\image.csproj.FileListAbsolute.txt
文件 977 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\obj\Debug\image.csproj.GenerateResource.Cache
文件 2211 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\obj\Debug\image.csprojResolveAssemblyReference.cache
文件 158208 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\obj\Debug\image.exe
文件 68212 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\obj\Debug\image.Form1.resources
文件 46592 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\obj\Debug\image.pdb
文件 180 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\obj\Debug\image.Properties.Resources.resources
文件 0 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
文件 0 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
文件 0 2018-07-03 23:16 (2017.09.16)串口图像上位机\image\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
文件 579 2018-07-03 23:00 (2017.09.16)串口图像上位机\image\Program.cs
文件 1434 2018-07-03 23:09 (2017.09.16)串口图像上位机\image\Properties\AssemblyInfo.cs
文件 2862 2018-07-03 23:09 (2017.09.16)串口图像上位机\image\Properties\Resources.Designer.cs
文件 5612 2018-07-03 23:09 (2017.09.16)串口图像上位机\image\Properties\Resources.resx
文件 1092 2018-07-03 23:09 (2017.09.16)串口图像上位机\image\Properties\Settings.Designer.cs
文件 249 2018-07-03 23:09 (2017.09.16)串口图像上位机\image\Properties\Settings.settings
............此处省略132个文件信息
- 上一篇:360环视摄像头鱼眼四摄像头拼接算法
- 下一篇:RD kit官方指南
相关资源
- 易语言OTG串口通信
- delphi 串口通讯
- STM32蓝牙和串口程序
- LCD显示温度+串口接收温度.rar
- WPF USB 网络 串口 通信软件
- DELPHI与西门子200PLC的串口通信实例
- B/S 网上订餐系统
- Verilog FPGA UART串口控制器
- USB转串口驱动,FT232R驱动程序,最新
- 教室管理系统.rar
- PC -- 单片机的串口数据传输系统设计
- 小鸡快跑游戏.
- STM32F103 串口程序(完整版)
- stm32 ds18b20 温度传感器 测试通过
- PC 串口调试软件
- 51单片机读取温度数据存储到SD卡中并
-
分别适用于.NET fr
amework 2.0和4.0的E - 汽车租赁系统............................
- 单片机与PC机串口通讯仿真
- 串口调试助手V5.0
- 双串口调试助手 V4.0 _ 可同时调试两个
- 读取串口数据并画实时曲线的VC 程序
- 德卡D8读写器关于读写感应卡的一些代
- halcon 测量助手
- 网络(UDP)转串口程序
- 图片存储到数据库保存二进制文件并
- 串口绘制曲线 将收到的数据进行曲线
- 基于ARM蓝牙传输源程序
- JS操作本地网页串口源码
- 用Socket写的简易FTP服务器和客户端
评论
共有 条评论