资源简介
C#读取SD卡中的数据,并在指定文件夹中显示出图片!
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.IO.Ports;
using System.Text;
using System.Text.Regularexpressions;
using System.Windows.Forms;
using System.Drawing.Imaging;
using INIFILE;
namespace SDcard
{
public partial class Form1 : Form
{
string Datetime_hour Datetime_minute Datetime_second Datetime_Day;
string path = @“D:\MySdPicture\“;
string path1;
int number_camera=0;
private List ReceiveBuffer = new List(10000000);
private byte[] Receivebuffer = new byte[100000];
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender EventArgs e)
{
INIFILE.Profile.LoadProfile(); //加载所有
textBoxPictureHeight.Text = Profile.G_PictureHeight;
textBoxPictureWidth.Text = Profile.G_PictureWidth;
textBoxPictureNumbers.Text = Profile.G_PictureNumbers;
textBoxStartSector.Text = Profile.G_StartSector;
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
Datetime_hour = DateTime.Now.Hour.ToString();
Datetime_minute = DateTime.Now.Minute.ToString();
Datetime_Day = DateTime.Now.Day.ToString();
Datetime_second = DateTime.Now.Second.ToString();
path1 = path + Datetime_Day + ‘.‘ + Datetime_hour + ‘.‘ + Datetime_minute + ‘.‘ + Datetime_second + “\\“;
}
SDUtils SDutils = new SDUtils(“J:“);
private void ReadOnePicture(long SectorIndex)
{
UInt32 SectorNumbers =(Convert.ToUInt32(textBoxPictureWidth.Text)*Convert.ToUInt32(textBoxPictureHeight.Text)/8+512/2-1)/512;
try
{
try
{
for (int i = 0; i < SectorNumbers; i++)
{
ReceiveBuffer.AddRange(SDutils.ReadSector(SectorIndex + i));
}
ReceiveBuffer.CopyTo(Receivebuffer);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Bitmap b = new Bitmap(Convert.ToInt32(textBoxPictureWidth.Text) Convert.ToInt32(textBoxPictureHeight.Text));// .Width pictureBoxCamera.Height);
UInt32 temp tempY;
UInt32 bitflag = 128;
try
{
for (UInt32 y = 0; y < Convert.ToUInt32(textBoxPictureHeight.Text); y++) //在开窗区域的纵轴扫描
{
for (UInt32 x = 0; x < Convert.ToUInt32(textBoxPictureWidth.Text); x++)
{
tempY = y * Convert.ToUInt32(textBoxPictureWidth.Text);
temp = x + tempY;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-06-17 10:52 SDcard\
目录 0 2013-06-17 13:15 SDcard\SDcard\
文件 1002 2013-06-17 13:25 SDcard\SDcard.sln
文件 21504 2013-06-17 13:32 SDcard\SDcard.suo
目录 0 2013-06-17 10:52 SDcard\SDcard\bin\
目录 0 2013-06-17 13:25 SDcard\SDcard\bin\Debug\
文件 101 2013-06-17 15:34 SDcard\SDcard\bin\Debug\Cfg.ini
文件 18944 2013-06-17 15:32 SDcard\SDcard\bin\Debug\SDcard.exe
文件 44544 2013-06-17 15:32 SDcard\SDcard\bin\Debug\SDcard.pdb
文件 11600 2013-06-17 15:34 SDcard\SDcard\bin\Debug\SDcard.vshost.exe
文件 490 2009-08-31 00:40 SDcard\SDcard\bin\Debug\SDcard.vshost.exe.manifest
文件 6601 2013-06-17 15:32 SDcard\SDcard\Form1.cs
文件 8831 2013-06-17 14:48 SDcard\SDcard\Form1.Designer.cs
文件 5817 2013-06-17 14:48 SDcard\SDcard\Form1.resx
文件 7503 2013-06-17 13:15 SDcard\SDcard\IniFile.cs
目录 0 2013-06-17 10:52 SDcard\SDcard\obj\
目录 0 2013-06-17 10:52 SDcard\SDcard\obj\x86\
目录 0 2013-06-17 15:32 SDcard\SDcard\obj\x86\Debug\
文件 2152 2013-06-17 10:52 SDcard\SDcard\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6196 2013-06-17 15:32 SDcard\SDcard\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 200 2013-06-17 14:48 SDcard\SDcard\obj\x86\Debug\GenerateResource.read.1.tlog
文件 494 2013-06-17 14:48 SDcard\SDcard\obj\x86\Debug\GenerateResource.write.1.tlog
文件 619 2013-06-17 15:34 SDcard\SDcard\obj\x86\Debug\SDcard.csproj.FileListAbsolute.txt
文件 18944 2013-06-17 15:32 SDcard\SDcard\obj\x86\Debug\SDcard.exe
文件 180 2013-06-17 14:48 SDcard\SDcard\obj\x86\Debug\SDcard.Form1.resources
文件 44544 2013-06-17 15:32 SDcard\SDcard\obj\x86\Debug\SDcard.pdb
文件 180 2013-06-17 13:25 SDcard\SDcard\obj\x86\Debug\SDcard.Properties.Resources.resources
目录 0 2013-06-17 10:52 SDcard\SDcard\obj\x86\Debug\TempPE\
文件 1618 2013-06-17 13:25 SDcard\SDcard\Profile.cs
文件 487 2013-06-17 10:52 SDcard\SDcard\Program.cs
目录 0 2013-06-17 10:52 SDcard\SDcard\Properties\
............此处省略7个文件信息
- 上一篇:C# winform sidebar控件
- 下一篇:PuyoPuyo游戏
相关资源
- PuyoPuyo游戏
- C# winform sidebar控件
- 利用C#语言开发K-Means聚类算法
- C#将SQL Server备份bak文件恢复
- 用c#写的多线程求PI
- 矩阵常用算法C#程序
- 网页设计,c#,ico小图标,共851个!
- 用C#写的小程序
- WinForm验证码源码
- C#模仿Win7标准计算器
- Galil C#通讯链接范例
- C#制作一个简易画图工具
- 飞行棋代码
- 禁止商业用途RPG游戏C#(登陆注册,背
- Huffman树练习
- C# 数字键盘实现
- C# mysql、sqlserver连接demo源码
- winform自绘波形,鼠标滚轮滚动缩放波
- C#仿真飞行仪表盘
- C#动态添加数据到折线图
- C# winform 宿舍管理系统 ,vs2010开发,
- 基于C#邮件客户端
- C#酒店管理系统(报告+代码+讲义)
- 打砖块小游戏,C#源码
- C#贪吃蛇源码
- 豆瓣API接口获取书籍详细信息C#
- 粒子群算法求解TSP问题
- 网络TCPServer转串口UART源码
- C#实现坐标转换,七参数之间进行数据
- c#基础复习题含答案
评论
共有 条评论