资源简介
图片鼠标,键盘事件,右键正转,左键反转,鼠标上下左右。完整代码,截图,报告!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#图片转换成二进制流并且保存到sq
- 多级 图片压缩工具c#
- C#图片匹配坐标
- C#用NPOI固定模版导出数据到excel表格
- C# 图片循环滚动
- c#图像处理bmp转化为灰度图片
- C#动态生成含有图片、图标、表格的
- c# 打怪兽的游戏
- c# word模板插入图片
- C#读取psd格式图片
- c#拼图游戏可换图,选难度,计时,统
- C#调用SynoAPIEx.dll接口采集指纹信息+绘
- 处理图片背景色,使用透明C#&图片处
- C#批量图片格式转换完整源码-jVox.ra
- C#柔化方式显示图像_源代码
- C#简易图片编辑器 vs2010
- 用C#编程调用Visio的COM接口,获取Vis
- ASP.Net生成一个简单的图片
- 文件/图片服务器上传asp.net源码,含服
- 比较图片相似度技术
- C# 读取word文档和图片
- WinForm在PictrueBox控件上建立矩形选框裁
- c#单击按钮、滑轮滚动放大、缩小pi
- C#RDLC动态加载图片
- 用C#做的一个画图板工具,可以打开图
- C#网络爬虫源码.zip
- C#Storyboard实现图片旋转
- C# winfrom中webservice接口连接服务器上传
- C# WinForm DirectShow视频采集及图片抓取
- C#XPS 转为图片并保存
评论
共有 条评论