资源简介
关于图学的实验 二维图形的几何变换 C#做的 MFC界面

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace yy
{
public partial class Form1 : Form
{
Graphics g;
Point[] points = new Point[3];
Point[] pointa = new Point[3];
int n;
public Form1()
{
InitializeComponent();
points[0] = new Point(30 20);
points[1] = new Point(200 40);
points[2] = new Point(200 100);
pointa = points;
n = 3;
}
Point pingyi(Point b int i int j) //平移
{
b.X += i;
b.Y += j;
return b;
}
Point suoxiao(Point a double m) //放缩
{
a.X = Convert.ToInt32(m * a.X);
a.Y = Convert.ToInt32(m * a.Y);
return a;
}
Point xuanzhuan(Point a double c) //旋转
{
int x = a.X;
int y = a.Y;
a.X = Convert.ToInt32(x*Math .Cos (c)-y *Math .Sin (c) );
a.Y = Convert.ToInt32(x*Math .Sin(c )+y *Math .Cos(c));
return a;
}
Point duichen(Point aint i) //x轴对称
{
if (i == 1) //x轴对称
{
a.Y = -a.Y;
}
if (i == 2) //y轴对称
{
a.X = -a.X;
}
if (i == 3)
{
a.X = -a.X;
a.Y = -a.Y;
}
return a;
}
Point cuoqie(Point a double b double d) //错切
{
int x=a.X;
int y=a.Y;
if (d == 0)
{
a.X =Convert .ToInt32( x + b * y);
}
else
{
a.Y = Convert .ToInt32( d * x + y);
}
return a;
}
void draw(Point[] pointm) //画图函数
{
g = this.panel1.CreateGraphics();
g.Clear(panel1 . BackColor);
g.TranslateTransform(215 215);
g.DrawLine(new Pen(new SolidBrush(Color.Black )) new Point(-300 0) new Point(300 0));
g.DrawLine(new Pen(new SolidBrush(Color.Black)) new Point(0 -300) new Point(0 300));
g.DrawPolygon(new Pen(new SolidBrush(Color.Blue)) pointm);
g.DrawPolygon(new Pen(new SolidBrush(Color.Blue)) pointm);
g.Dispose();
}
private void butret_Click(object sender EventArgs e) //还原
{
pointa[0] = new Point(30 20);
pointa[1] = new Point(200 40);
pointa[2] = new Point(200 100);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 318896 2010-04-27 00:56 096-黄莹-第四次实验\096-黄莹-第四次实验.doc
文件 17408 2010-04-27 00:52 096-黄莹-第四次实验\yy\yy\bin\Debug\yy.exe
文件 38400 2010-04-27 00:52 096-黄莹-第四次实验\yy\yy\bin\Debug\yy.pdb
文件 14328 2010-05-12 21:58 096-黄莹-第四次实验\yy\yy\bin\Debug\yy.vshost.exe
文件 490 2007-07-21 01:33 096-黄莹-第四次实验\yy\yy\bin\Debug\yy.vshost.exe.manifest
文件 7214 2010-04-27 00:52 096-黄莹-第四次实验\yy\yy\Form1.cs
文件 18491 2010-04-27 00:37 096-黄莹-第四次实验\yy\yy\Form1.Designer.cs
文件 5814 2010-04-27 00:37 096-黄莹-第四次实验\yy\yy\Form1.resx
文件 1640 2010-05-12 21:58 096-黄莹-第四次实验\yy\yy\obj\Debug\yy.csproj.FileListAbsolute.txt
文件 847 2010-04-27 00:37 096-黄莹-第四次实验\yy\yy\obj\Debug\yy.csproj.GenerateResource.Cache
文件 17408 2010-04-27 00:52 096-黄莹-第四次实验\yy\yy\obj\Debug\yy.exe
文件 180 2010-04-27 00:37 096-黄莹-第四次实验\yy\yy\obj\Debug\yy.Form1.resources
文件 38400 2010-04-27 00:52 096-黄莹-第四次实验\yy\yy\obj\Debug\yy.pdb
文件 180 2010-04-25 19:52 096-黄莹-第四次实验\yy\yy\obj\Debug\yy.Properties.Resources.resources
文件 483 2010-04-25 19:40 096-黄莹-第四次实验\yy\yy\Program.cs
文件 1400 2010-04-25 19:40 096-黄莹-第四次实验\yy\yy\Properties\AssemblyInfo.cs
文件 2854 2010-04-25 19:40 096-黄莹-第四次实验\yy\yy\Properties\Resources.Designer.cs
文件 5612 2010-04-25 19:40 096-黄莹-第四次实验\yy\yy\Properties\Resources.resx
文件 1087 2010-04-25 19:40 096-黄莹-第四次实验\yy\yy\Properties\Settings.Designer.cs
文件 249 2010-04-25 19:40 096-黄莹-第四次实验\yy\yy\Properties\Settings.settings
文件 3750 2010-04-25 19:52 096-黄莹-第四次实验\yy\yy\yy.csproj
文件 896 2010-04-25 19:40 096-黄莹-第四次实验\yy\yy.sln
..A..H. 14336 2010-05-12 22:00 096-黄莹-第四次实验\yy\yy.suo
目录 0 2010-05-13 22:33 096-黄莹-第四次实验\yy\yy\obj\Debug\Refactor
目录 0 2010-05-13 22:33 096-黄莹-第四次实验\yy\yy\obj\Debug\TempPE
目录 0 2010-05-13 22:33 096-黄莹-第四次实验\yy\yy\bin\Debug
目录 0 2010-05-13 22:33 096-黄莹-第四次实验\yy\yy\obj\Debug
目录 0 2010-05-13 22:33 096-黄莹-第四次实验\yy\yy\bin
目录 0 2010-05-13 22:33 096-黄莹-第四次实验\yy\yy\obj
目录 0 2010-05-13 22:33 096-黄莹-第四次实验\yy\yy\Properties
............此处省略6个文件信息
相关资源
- C语言实现的DES对称加密算法
- 编译原理实验-词法分析(c语言代码)
- 串口实验(接收与发送)
- STM32(神舟III号 串口1发送实验程序)
- STM32跑马灯实验58159
- CAN实验
- 数据结构实验源代码集
- 实验报告:数据结构长整数四则运算
- 交互式计算机图形学 第六版 OpenGL源代
- 图形学简单绘图系统
- Arduino-LM35-LCD1602数字温度计实验.doc
- 门禁控制系统实验-V20170317
- 操作系统存储管理实验报告c/c++
- 微机接口----HQFC集成开发环境.zip
- 数据结构实验——赫夫曼树相关
- 编译原理实验报告+代码+使用说明
- 谭浩强《C++面向对象程序设计》实验
- 面向对象编程MFC综合实验代码
- OpenGL迷宫山东大学图形学实验三
- C语言程序设计教程第二版习题解答与
- c++版学生成绩管理系统实验报告及源
- 语法分析c语言实现程序代码+实验报告
- plo编译器 c语言 含测试 以及实验报告
- C语言实现51单片机和ADC0809芯片的AD模
- 基于80C51单片机的20多个仿真实验
- 网络编程MFC 实验四 FTP客户端功能实现
- 操作系统——5个实验.zip
- 华中科技大学-C++实验 共6次-源代码
- 山东大学编译原理实验源代码c++版
- 粤嵌实验室项目基础教程
评论
共有 条评论