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#程序設(shè)計有所幫助。
您可能感興趣的文章:
- C#實現(xiàn)Windows Form調(diào)用R進(jìn)行繪圖與顯示的方法
- C#打印繪圖的實現(xiàn)方法
- C# GDI在控件上繪圖的方法
- 混合語言編程—C#使用原生的Directx和OpenGL繪圖的方法
- 深入c# GDI+簡單繪圖的具體操作步驟(四)
- 深入c# GDI+簡單繪圖的具體操作步驟(三)
- 深入c# GDI+簡單繪圖的具體操作步驟(二)
- 深入c# GDI+簡單繪圖的具體操作步驟(一)
- C#中GraphicsPath的AddString方法用法實例
- C#中GraphicsPath的Warp方法用法實例
- C#中GraphicsPath的Flatten方法用法實例
- C#實現(xiàn)動態(tài)數(shù)據(jù)繪圖graphic的方法示例
相關(guān)文章
c# 給button添加不規(guī)則的圖片以及用pictureBox替代button響應(yīng)點擊事件的方法
這篇文章介紹了c# 給button添加不規(guī)則的圖片以及用pictureBox替代button響應(yīng)點擊事件的方法,有需要的朋友可以參考一下2013-09-09
結(jié)合Visual C#開發(fā)環(huán)境講解C#中事件的訂閱和取消訂閱
這篇文章主要介紹了C#中事件的訂閱和取消訂閱,結(jié)合Visual C#開發(fā)環(huán)境來進(jìn)行講解,Visual C#被集成在微軟的IDE程序Visual Studio中,需要的朋友可以參考下2016-01-01
C#中將xml文件反序列化為實例時采用基類還是派生類的知識點討論
在本篇文章里小編給大家整理的是關(guān)于C#中將xml文件反序列化為實例時采用基類還是派生類的知識點討論,有需要的朋友們學(xué)習(xí)下。2019-11-11
C# WinForm狀態(tài)欄實時顯示當(dāng)前時間(窗體狀態(tài)欄StatusStrip示例)
這篇文章主要介紹了C# WinForm狀態(tài)欄實時顯示當(dāng)前時間(窗體狀態(tài)欄StatusStrip示例),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2021-01-01
WinForm開發(fā)中屏蔽WebBrowser腳本錯誤提示的方法
這篇文章主要介紹了WinForm開發(fā)中屏蔽WebBrowser腳本錯誤提示的方法,在C#項目開發(fā)中比較實用,需要的朋友可以參考下2014-08-08
C#數(shù)組學(xué)習(xí)相關(guān)資料整理
最近開始學(xué)習(xí)c#,并有幸接觸到了數(shù)組方便的操作,感覺確實不錯,這里簡單的整理下c#相關(guān)的學(xué)習(xí)資料,方便大家學(xué)習(xí)2012-09-09

