作业:文档形式

3到5页理解

1.理解

2.源代码解释(1到2页)

3.实现效果

项目地址: https://github.com/zhiyishou/polyer

Demo:https://zhiyishou.github.io/Polyer

[图形学]Delaunay三角剖分算法附C++实现

https://blog.csdn.net/qq_31804159/article/details/81709423

算法丨带内外边界的三角剖分算法(Delaunay)

https://blog.csdn.net/npu2017302288/article/details/80460552

三角剖分算法(delaunay)

https://www.cnblogs.com/zhiyishou/p/4430017.html

GDI

https://www.cnblogs.com/stg609/archive/2008/03/16/1108333.html

1.pen类创建画笔对象:

1) 新建一个Windows应用程序,适当加宽窗体宽度。然后切换到代码方式,添加名称空间引用:
using System.Drawing.Drawing2D;
2) 添加Form1_Paint事件代码

3)在Form1_Load中手动添加paint事件:

this.Paint += new PaintEventHandler(Form1_Paint);

 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms; namespace drawpicture
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics; //创建画板,这里的画板是由Form提供的.
Pen pen = new Pen(Color.Blue, 10.5f);
g.DrawString("蓝色,宽度为10.5", this.Font,
new SolidBrush(Color.Black), , );
g.DrawLine(pen, new Point(, ), new Point(, ));
pen.Width = ;
pen.Color = Color.Red;
g.DrawString("红色,宽度为2", this.Font,
new SolidBrush(Color.Black), , );
g.DrawLine(pen, new Point(, ), new Point(, ));
pen.StartCap = LineCap.Flat;
pen.EndCap = LineCap.ArrowAnchor;
pen.Width = ;
g.DrawString("红色箭头线", this.Font,
new SolidBrush(Color.Black), , );
g.DrawLine(pen, new Point(, ), new Point(, ));
pen.DashStyle = DashStyle.Custom;
pen.DashPattern = new float[] { , };
pen.Width = ;
pen.EndCap = LineCap.NoAnchor;
g.DrawString("自定义虚线", this.Font,
new SolidBrush(Color.Black), , );
g.DrawLine(pen, new Point(, ), new Point(, ));
pen.DashStyle = DashStyle.Dot;
g.DrawString("点划线", this.Font, new SolidBrush(Color.Black), , );
g.DrawLine(pen, new Point(, ), new Point(, ));
}
private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
{ } private void Form1_Load(object sender, EventArgs e)
{
this.Paint += new PaintEventHandler(Form1_Paint);
} private void button1_Click(object sender, EventArgs e)
{ }
}
}

整个源码

运行情况:

2.画刷

public void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
SolidBrush myBrush = new SolidBrush(Color.Red);
g.FillEllipse(myBrush, this.ClientRectangle);
}

c#之GDI简单实现代码及其实例的更多相关文章

  1. 一个简单的Android小实例

    原文:一个简单的Android小实例 一.配置环境 1.下载intellij idea15 2.安装Android SDK,通过Android SDK管理器安装或卸载Android平台   3.安装J ...

  2. C/C++代码检视实例

    相关文章链接如下: 微软过桥问题与测试人员素养 等价类分法 新解 测试用例设计中的NP难题 90%程序员写不出无BUG的二分查找程序? C/C++代码检视要点 4.1             代码检视 ...

  3. Linux下简单的socket通信实例

    Linux下简单的socket通信实例 If you spend too much time thinking about a thing, you’ll never get it done. —Br ...

  4. PureMVC和Unity3D的UGUI制作一个简单的员工管理系统实例

    前言: 1.关于PureMVC: MVC框架在很多项目当中拥有广泛的应用,很多时候做项目前人开坑开了一半就消失了,后人为了填补各种的坑就遭殃的不得了.嘛,程序猿大家都不喜欢像文案策划一样组织文字写东西 ...

  5. Hibernate入门2.简单的项目开发实例

    Hibernate入门2.简单的项目开发实例 这一节通过一个简单的项目学习Hibernate项目的配置 代码下载 : 链接: http://pan.baidu.com/s/1zlgjl 密码: p34 ...

  6. html简单标签代码

     html简单标签代码demo <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "ht ...

  7. Lucene.net站内搜索—3、最简单搜索引擎代码

    目录 Lucene.net站内搜索—1.SEO优化 Lucene.net站内搜索—2.Lucene.Net简介和分词Lucene.net站内搜索—3.最简单搜索引擎代码Lucene.net站内搜索—4 ...

  8. JS Map 和 List 的简单实现代码

    javascript中是没有map和list 结构的. 本篇文章是对在JS中Map和List的简单实现代码进行了详细的分析介绍,需要的朋友参考下 代码如下: /* * MAP对象,实现MAP功能 *  ...

  9. python网页请求urllib2模块简单封装代码

    这篇文章主要分享一个python网页请求模块urllib2模块的简单封装代码. 原文转自:http://www.jbxue.com/article/16585.html 对python网页请求模块ur ...

随机推荐

  1. Java-马士兵设计模式学习笔记-工厂模式-抽象工厂模式

    一.概述 1.抽象工厂:当情况是需要产生一系列产品,若需更换产品,则要求一系列产品一起换,且要控制一系列产品的产生过程,此时可考虑抽象工厂模式.例:小明装修屋子,把电视.冰箱都替换掉,他这次需要把电视 ...

  2. 使用database control配置数据库时 要求在当前oracle主目录中配置监听程序

    1:配置本地的环境变量 打开cmd命令界面  C:\Users\gechong>lsnrctl start 这时候报适配器错误 2.在cmd中输入 tnslsnr命令

  3. Entity Framework Tutorial Basics(4):Setup Entity Framework Environment

    Setup Entity Framework Environment: Entity Framework 5.0 API was distributed in two places, in NuGet ...

  4. 关于Spring注解配置的步骤

    今天分享一下 关于Spring注解配置的流程 1 导包:如下图所示 2 书写User和Car类  代码如下 package cn.lijun.bean; public class Car { priv ...

  5. ElementUI的表单和vee-validate结合使用时发生冲突的解决

    在Vue项目中使用ElementUI表单时,同时又引入了vee-validate进行使用的时候,在浏览器上会出现这样的报错: [Vue warn]: The computed property &qu ...

  6. MVC中使用代码创建数据库(code first +mysql+EF)

    1.新建一个mvc项目 2.安装mysql需要的几个文件 EntityFramework.MySql.Data(6.9.12)和MySql.Data.Entity (6.9.12) 这里有几点要注意 ...

  7. android studio中退出时弹出对话框

    在app中总是不小心点击了退出怎么办?当然是加个弹出的提示框了,本人新手,就加在主界面上了 @Override public boolean onKeyDown(int keyCode, KeyEve ...

  8. CefSharp使用一

    一.使用NuGet搜索CefSharp然后下载CefSharp.WinForms和CefSharp.Common 二.引用CefSharp.Windows,CefSharp,CefSharp三个dll ...

  9. 用LINQ获取XML节点数据

    Insus.NET想对<从字符串中获取XML节点数据> http://www.cnblogs.com/insus/p/3299052.html 这篇改写为使用LINQ的方法实现.LINQ中 ...

  10. ASP.NET网页动态添加数据行

    一看到这标题<ASP.NET网页动态添加数据行>,想起来似乎有点难实现.因为网页的周期性原因,往往在PostBack之后,状态难于有所保留.但Insus.NET又想实现这样的效果,用户点击 ...