资源简介
图片鼠标,键盘事件,右键正转,左键反转,鼠标上下左右。完整代码,截图,报告!c#

代码片段和文件信息
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
namespace WindowsFormsApplication5
{
public partial class Form1 : Form
{
int xx = 0;//初始化x坐标移动距离
int yy = 0;//初始化y坐标移动距离
int jiaodu = 10;//初始化旋转角度
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender EventArgs e)
{
}
private void Form1_KeyDown(object sender KeyEventArgs e)
{
Graphics g = this.CreateGraphics();
Bitmap curBitmap = new Bitmap(@“11.jpg“);
Matrix X = new Matrix();
if (e.KeyValue == 37)//判断键盘左键
{ xx -= 10;
g.Clear(this.BackColor);
X.Translate(xx yy);
g.Transform = X;
g.DrawImage(curBitmap
new Rectangle(100 100 200 200)
0 0 curBitmap.Width
curBitmap.Height
GraphicsUnit.Pixel);
label1.Text = “图片向左移动“+10;
curBitmap.Dispose();
g.Dispose();
}
if (e.KeyValue == 38)//判断键盘上键
{
yy -= 10;
g.Clear(this.BackColor);
X.Translate(xx yy);
g.Transform = X;
g.DrawImage(curBitmap
new Rectangle(100 100 200 200)
0 0 curBitmap.Width
curBitmap.Height
GraphicsUnit.Pixel);
label1.Text = “图片向上移动“ + 10;
curBitmap.Dispose();
g.Dispose();//释放资源
}
if (e.KeyValue == 39)//判断键盘右键
{
xx += 10;
g.Clear(this.BackColor);
X.Translate(xx yy);
g.Transform = X;
g.DrawImage(curBitmap
new Rectangle(100 100 200 200)
0 0 curBitmap.Width
curBitmap.Height
GraphicsUnit.Pixel);
curBitmap.Dispose();
g.Dispose();//释放资源
label1.Text = “图片向右移动“ + 10;
}
if (e.KeyValue == 40)//判断键盘下键
{
yy += 10;
g.Clear(this.BackColor);
X.Translate(xx yy);
g.Transform = X;
g.DrawImage(curBitmap
new Rectangle(100 100 200 200)
0 0 curBitmap.Width
curBitmap.Height
GraphicsUnit.Pixel);
curBitmap.Dispose();
g.Dispose();//释放资
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 13522 2009-11-29 08:55 WindowsFormsApplication6000\WindowsFormsApplication5\bin\Debug\11.jpg
文件 12288 2009-11-29 09:04 WindowsFormsApplication6000\WindowsFormsApplication5\bin\Debug\WindowsFormsApplication5.exe
文件 36352 2009-11-29 09:04 WindowsFormsApplication6000\WindowsFormsApplication5\bin\Debug\WindowsFormsApplication5.pdb
文件 14328 2009-11-29 09:04 WindowsFormsApplication6000\WindowsFormsApplication5\bin\Debug\WindowsFormsApplication5.vshost.exe
文件 490 2009-06-11 05:14 WindowsFormsApplication6000\WindowsFormsApplication5\bin\Debug\WindowsFormsApplication5.vshost.exe.manifest
文件 5522 2009-11-29 09:04 WindowsFormsApplication6000\WindowsFormsApplication5\Form1.cs
文件 3378 2009-11-29 08:45 WindowsFormsApplication6000\WindowsFormsApplication5\Form1.Designer.cs
文件 7730 2009-11-29 08:45 WindowsFormsApplication6000\WindowsFormsApplication5\Form1.resx
文件 2350 2009-11-29 09:01 WindowsFormsApplication6000\WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.csproj.FileListAbsolute.txt
文件 847 2009-11-29 08:45 WindowsFormsApplication6000\WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.csproj.GenerateResource.Cache
文件 12288 2009-11-29 09:04 WindowsFormsApplication6000\WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.exe
文件 1644 2009-11-29 08:45 WindowsFormsApplication6000\WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.Form1.resources
文件 36352 2009-11-29 09:04 WindowsFormsApplication6000\WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.pdb
文件 180 2009-11-28 12:34 WindowsFormsApplication6000\WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.Properties.Resources.resources
文件 1062 2009-11-29 09:04 WindowsFormsApplication6000\WindowsFormsApplication5\obj\Debug\WindowsFormsApplication6000.csproj.FileListAbsolute.txt
文件 847 2009-11-29 09:04 WindowsFormsApplication6000\WindowsFormsApplication5\obj\Debug\WindowsFormsApplication6000.csproj.GenerateResource.Cache
文件 505 2009-11-28 12:32 WindowsFormsApplication6000\WindowsFormsApplication5\Program.cs
文件 1404 2009-11-28 12:32 WindowsFormsApplication6000\WindowsFormsApplication5\Properties\AssemblyInfo.cs
文件 2898 2009-11-28 12:32 WindowsFormsApplication6000\WindowsFormsApplication5\Properties\Resources.Designer.cs
文件 5612 2009-11-28 12:32 WindowsFormsApplication6000\WindowsFormsApplication5\Properties\Resources.resx
文件 1109 2009-11-28 12:32 WindowsFormsApplication6000\WindowsFormsApplication5\Properties\Settings.Designer.cs
文件 249 2009-11-28 12:32 WindowsFormsApplication6000\WindowsFormsApplication5\Properties\Settings.settings
文件 3759 2009-11-28 12:34 WindowsFormsApplication6000\WindowsFormsApplication5\WindowsFormsApplication6000.csproj
文件 968 2009-11-29 09:01 WindowsFormsApplication6000\WindowsFormsApplication6000.sln
..A..H. 15872 2009-11-29 09:04 WindowsFormsApplication6000\WindowsFormsApplication6000.suo
目录 0 2009-11-28 12:32 WindowsFormsApplication6000\WindowsFormsApplication5\obj\Debug\TempPE
目录 0 2009-11-29 08:56 WindowsFormsApplication6000\WindowsFormsApplication5\bin\Debug
目录 0 2009-11-29 09:04 WindowsFormsApplication6000\WindowsFormsApplication5\obj\Debug
目录 0 2009-11-28 12:32 WindowsFormsApplication6000\WindowsFormsApplication5\bin
目录 0 2009-11-28 12:32 WindowsFormsApplication6000\WindowsFormsApplication5\obj
............此处省略6个文件信息
相关资源
- C# 使用ListView控件实现图片浏览器(源
- c#向word文件插入图片
- C#实现在picturebox内画矩形,并将局部
- C#处理png图片位深度和交错属性
- C# 无损压缩图片
- svg批量转jpg|png
- TCP通信(支持发送文本和图片文件)
- 图片二进制读取数据库(附数据库)
- C#图片取点获取对应坐标参数工具
- 纯色背景透明化/替换色工具(C# 源码
- 图像图片灰度、反色、二值化、腐蚀
- C# 图片亮度对比度,自动纠偏
- c# 多线程传图片
- 动态移动图片
- winform 界面图片轮播效果
- panel内容打印(图片打印)
- MVC图片上传实例58438
- c#车牌识别系统附30张测试图片
- 安卓和asp.net通过webservice上传图片到服
- C#绘图和图片放大缩小等功能代码
- winform图片标尺,画矩形
- C# PDF转图片
- C#做的一个图片浏览器源码
- 大图找小图 C#图片对比高速找图源码
- c# 图像旋转 winform 窗体 图片转动
- SQLserver+C#实现的KTV点歌系统 有数据库
- C#在图片中写入文字
- 用c#将pdf文件转换成图片文件
- C#源码:批量自动去除图片白边
- WinForm 实现图片滚动
评论
共有 条评论