C#中GraphicsPath的Widen方法用法实例
更新时间:2015年06月12日 14:41:10 作者:zhuzhao
这篇文章主要介绍了C#中GraphicsPath的Widen方法用法,实例分析了Widen方法的使用技巧,需要的朋友可以参考下
本文实例讲述了C#中GraphicsPath的Widen方法用法。分享给大家供大家参考。具体如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
namespace advanced_drawing
{
public partial class Form12 : Form
{
public Form12()
{
InitializeComponent();
}
private void Form12_Paint(object sender, PaintEventArgs e)
{
// Create a path and add two ellipses.
GraphicsPath myPath = new GraphicsPath();
myPath.AddEllipse(0, 0, 100, 100);
myPath.AddEllipse(100, 0, 100, 100);
// Draw the original ellipses to the screen in black.
e.Graphics.DrawPath(Pens.Blue, myPath);
// Widen the path.
Pen widenPen = new Pen(Color.Black, 10);
Matrix widenMatrix = new Matrix();
widenMatrix.Translate(50, 50);
myPath.Widen(widenPen, widenMatrix, 1.0f);
// Draw the widened path to the screen in red.
e.Graphics.FillPath(new SolidBrush(Color.Red), myPath);
}
}
}
希望本文所述对大家的C#程序设计有所帮助。
相关文章
c# 给button添加不规则的图片以及用pictureBox替代button响应点击事件的方法
这篇文章介绍了c# 给button添加不规则的图片以及用pictureBox替代button响应点击事件的方法,有需要的朋友可以参考一下2013-09-09
结合Visual C#开发环境讲解C#中事件的订阅和取消订阅
这篇文章主要介绍了C#中事件的订阅和取消订阅,结合Visual C#开发环境来进行讲解,Visual C#被集成在微软的IDE程序Visual Studio中,需要的朋友可以参考下2016-01-01
C#中将xml文件反序列化为实例时采用基类还是派生类的知识点讨论
在本篇文章里小编给大家整理的是关于C#中将xml文件反序列化为实例时采用基类还是派生类的知识点讨论,有需要的朋友们学习下。2019-11-11
C# WinForm状态栏实时显示当前时间(窗体状态栏StatusStrip示例)
这篇文章主要介绍了C# WinForm状态栏实时显示当前时间(窗体状态栏StatusStrip示例),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2021-01-01
WinForm开发中屏蔽WebBrowser脚本错误提示的方法
这篇文章主要介绍了WinForm开发中屏蔽WebBrowser脚本错误提示的方法,在C#项目开发中比较实用,需要的朋友可以参考下2014-08-08


最新评论