C#中GraphicsPath的Flatten方法用法實(shí)例
更新時(shí)間:2015年06月12日 12:33:52 作者:zhuzhao
這篇文章主要介紹了C#中GraphicsPath的Flatten方法,實(shí)例分析了Flatten方法的相關(guān)使用技巧,需要的朋友可以參考下
本文實(shí)例講述了C#中GraphicsPath的Flatten方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
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 Form11 : Form
{
public Form11()
{
InitializeComponent();
}
private void Form11_Paint(object sender, PaintEventArgs e)
{
Matrix matrix=new Matrix();
matrix.Translate(10, 10);
GraphicsPath path = new GraphicsPath();
path.Transform(matrix);
Rectangle rect = new Rectangle(0, 0, 100, 100);
Graphics g = e.Graphics;
path.AddRectangle(rect);
g.DrawPath(Pens.Black, path);
path.Flatten(matrix, 10);
g.DrawPath(Pens.Red, path);
}
}
}
希望本文所述對(duì)大家的C#程序設(shè)計(jì)有所幫助。
您可能感興趣的文章:
- C#實(shí)現(xiàn)Windows Form調(diào)用R進(jìn)行繪圖與顯示的方法
- C#打印繪圖的實(shí)現(xiàn)方法
- C# GDI在控件上繪圖的方法
- 混合語言編程—C#使用原生的Directx和OpenGL繪圖的方法
- 深入c# GDI+簡單繪圖的具體操作步驟(四)
- 深入c# GDI+簡單繪圖的具體操作步驟(三)
- 深入c# GDI+簡單繪圖的具體操作步驟(二)
- 深入c# GDI+簡單繪圖的具體操作步驟(一)
- C#中GraphicsPath的AddString方法用法實(shí)例
- C#中GraphicsPath的Warp方法用法實(shí)例
- C#中GraphicsPath的Widen方法用法實(shí)例
- C#實(shí)現(xiàn)動(dòng)態(tài)數(shù)據(jù)繪圖graphic的方法示例
相關(guān)文章
C# 獲取打印機(jī)當(dāng)前狀態(tài)的方法
C# 獲取打印機(jī)當(dāng)前狀態(tài)的方法,需要的朋友可以參考一下2013-04-04
利用C#實(shí)現(xiàn)獲取當(dāng)前設(shè)備硬件信息
這篇文章主要為大家詳細(xì)介紹了如何利用C#實(shí)現(xiàn)獲取當(dāng)前設(shè)備硬件信息的功能,文中的示例代碼講解詳細(xì),感興趣的小伙伴可以跟隨小編一起了解一下2023-03-03
C#基礎(chǔ)知識(shí)之this關(guān)鍵字介紹
本文主要介紹this關(guān)鍵字的幾種使用方法,this可以代表當(dāng)前實(shí)例,可以調(diào)用其他構(gòu)造函數(shù),還可以用來構(gòu)建索引器,這里都有一一舉例說明。2016-04-04
c#基于NVelocity實(shí)現(xiàn)代碼生成
這篇文章主要介紹了c#基于NVelocity實(shí)現(xiàn)代碼生成的方法,幫助大家更好的理解和使用c#,感興趣的朋友可以了解下2021-01-01
C#使用正則表達(dá)式實(shí)現(xiàn)首字母轉(zhuǎn)大寫的方法
這篇文章主要介紹了C#使用正則表達(dá)式實(shí)現(xiàn)首字母轉(zhuǎn)大寫的方法,涉及C#基于正則表達(dá)式操作字符串的相關(guān)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-11-11

