C#中GraphicsPath的Widen方法用法實(shí)例
本文實(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#集合查詢(xún)Linq在項(xiàng)目中使用詳解
本文主要介紹了C#集合查詢(xún)Linq在項(xiàng)目中使用詳解,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2022-05-05
C# WinForm實(shí)現(xiàn)鼠標(biāo)穿透功能
在WinForm開(kāi)發(fā)時(shí),會(huì)用到這樣一個(gè)場(chǎng)景,給屏幕增加水印Logo,但不影響畫(huà)面的操作,這里就會(huì)用到鼠標(biāo)穿透功能,下面我們就來(lái)學(xué)習(xí)一下鼠標(biāo)穿透功能的具體實(shí)現(xiàn)吧2023-11-11
c#開(kāi)發(fā)word批量轉(zhuǎn)pdf源碼分享
已經(jīng)安裝有Office環(huán)境,借助一些簡(jiǎn)單的代碼即可實(shí)現(xiàn)批量Word轉(zhuǎn)PDF,看下面的實(shí)例源碼吧2013-12-12
C#把數(shù)組中的某個(gè)元素取出來(lái)放到第一個(gè)位置的實(shí)現(xiàn)方法
這篇文章主要介紹了C#把數(shù)組中的某個(gè)元素取出來(lái)放到第一個(gè)位置的實(shí)現(xiàn)方法,涉及C#針對(duì)數(shù)組的常見(jiàn)操作技巧,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2014-12-12
Unity實(shí)現(xiàn)多平臺(tái)二維碼掃描
這篇文章主要為大家詳細(xì)介紹了Unity實(shí)現(xiàn)多平臺(tái)二維碼掃描,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2019-07-07
C#實(shí)現(xiàn)數(shù)組元素的數(shù)據(jù)類(lèi)型轉(zhuǎn)換方法詳解
這篇文章主要為大家介紹了C#中一維數(shù)組如何快速實(shí)現(xiàn)數(shù)組元素的數(shù)據(jù)類(lèi)型的轉(zhuǎn)換,文中的示例代碼講解詳細(xì),感興趣的小伙伴可以了解一下2022-04-04

