C#中GraphicsPath的Widen方法用法實(shí)例
更新時(shí)間:2015年06月12日 14:41:10 作者:zhuzhao
這篇文章主要介紹了C#中GraphicsPath的Widen方法用法,實(shí)例分析了Widen方法的使用技巧,需要的朋友可以參考下
本文實(shí)例講述了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); } } }
希望本文所述對(duì)大家的C#程序設(shè)計(jì)有所幫助。
您可能感興趣的文章:
- C#實(shí)現(xiàn)Windows Form調(diào)用R進(jìn)行繪圖與顯示的方法
- C#打印繪圖的實(shí)現(xiàn)方法
- C# GDI在控件上繪圖的方法
- 混合語(yǔ)言編程—C#使用原生的Directx和OpenGL繪圖的方法
- 深入c# GDI+簡(jiǎn)單繪圖的具體操作步驟(四)
- 深入c# GDI+簡(jiǎn)單繪圖的具體操作步驟(三)
- 深入c# GDI+簡(jiǎn)單繪圖的具體操作步驟(二)
- 深入c# GDI+簡(jiǎn)單繪圖的具體操作步驟(一)
- C#中GraphicsPath的AddString方法用法實(shí)例
- C#中GraphicsPath的Warp方法用法實(shí)例
- C#中GraphicsPath的Flatten方法用法實(shí)例
- C#實(shí)現(xiàn)動(dòng)態(tài)數(shù)據(jù)繪圖graphic的方法示例
相關(guān)文章
C# WinForm實(shí)現(xiàn)鼠標(biāo)穿透功能
在WinForm開發(fā)時(shí),會(huì)用到這樣一個(gè)場(chǎng)景,給屏幕增加水印Logo,但不影響畫面的操作,這里就會(huì)用到鼠標(biāo)穿透功能,下面我們就來學(xué)習(xí)一下鼠標(biāo)穿透功能的具體實(shí)現(xiàn)吧2023-11-11C#把數(shù)組中的某個(gè)元素取出來放到第一個(gè)位置的實(shí)現(xiàn)方法
這篇文章主要介紹了C#把數(shù)組中的某個(gè)元素取出來放到第一個(gè)位置的實(shí)現(xiàn)方法,涉及C#針對(duì)數(shù)組的常見操作技巧,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2014-12-12Unity實(shí)現(xiàn)多平臺(tái)二維碼掃描
這篇文章主要為大家詳細(xì)介紹了Unity實(shí)現(xiàn)多平臺(tái)二維碼掃描,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2019-07-07C#實(shí)現(xiàn)數(shù)組元素的數(shù)據(jù)類型轉(zhuǎn)換方法詳解
這篇文章主要為大家介紹了C#中一維數(shù)組如何快速實(shí)現(xiàn)數(shù)組元素的數(shù)據(jù)類型的轉(zhuǎn)換,文中的示例代碼講解詳細(xì),感興趣的小伙伴可以了解一下2022-04-04