C#實(shí)現(xiàn)圖形路徑變換的方法
本文實(shí)例講述了C#實(shí)現(xiàn)圖形路徑變換的方法。分享給大家供大家參考。具體實(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 Form10 : Form
{
public Form10()
{
InitializeComponent();
}
GraphicsPath CreateLabeledRectPath(string label)
{
GraphicsPath path = new GraphicsPath();
Rectangle rect = new Rectangle(0, 0, 200, 200);
FontFamily fontFamily=new FontFamily("Arial");
path.AddString(label, fontFamily, 20, 20f, new Point(0, 0), new StringFormat());
return path;
}
private void Form10_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
GraphicsPath path = CreateLabeledRectPath("zhuzhao");
g.DrawPath(Pens.Red, path);
Matrix matrix = new Matrix();
matrix.Translate(150, 150);
path.Transform(matrix);
g.DrawPath(Pens.Black, path);
}
}
}
希望本文所述對(duì)大家的C#程序設(shè)計(jì)有所幫助。
相關(guān)文章
word ppt excel文檔轉(zhuǎn)換成pdf的C#實(shí)現(xiàn)代碼
這篇文章主要介紹了word ppt excel文檔轉(zhuǎn)換成pdf的C#實(shí)現(xiàn)代碼,有需要的朋友可以參考一下2014-01-01
C#中的Linq Intersect與Except方法使用實(shí)例
這篇文章主要介紹了C#中的Linq Intersect與Except方法使用實(shí)例,本文直接給出示例代碼,需要的朋友可以參考下2015-06-06
C#?Winform實(shí)現(xiàn)圓角無(wú)鋸齒按鈕
這篇文章主要介紹了C#?Winform實(shí)現(xiàn)圓角無(wú)鋸齒按鈕,文章圍繞主題展開(kāi)詳細(xì)的內(nèi)容介紹,具有一定的參考價(jià)值,感興趣的小伙伴可以參考一下2022-08-08
UGUI實(shí)現(xiàn)ScrollView無(wú)限滾動(dòng)效果
這篇文章主要為大家詳細(xì)介紹了UGUI實(shí)現(xiàn)ScrollView無(wú)限滾動(dòng)效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2019-02-02
C# 實(shí)現(xiàn)視頻監(jiān)控系統(tǒng)(附源碼)
這篇文章主要介紹了C# 如何實(shí)現(xiàn)視頻監(jiān)控系統(tǒng),幫助大家更好的理解和使用c#,感興趣的朋友可以了解下2021-02-02
C#數(shù)據(jù)結(jié)構(gòu)與算法揭秘二 線性結(jié)構(gòu)
本文中,我們討論了什么是線性結(jié)構(gòu),線性結(jié)構(gòu)有哪些特點(diǎn),并且詳細(xì)介紹了一個(gè)最簡(jiǎn)單線性結(jié)構(gòu)順序表,并且通過(guò)源代碼對(duì)她進(jìn)行一些列的分析,最后還舉了兩個(gè)例子,讓我們更好的理解順序表2012-11-11
C#使用jQuery實(shí)現(xiàn)無(wú)刷新評(píng)論提交的方法
這篇文章主要介紹了C#使用jQuery實(shí)現(xiàn)無(wú)刷新評(píng)論提交的方法,涉及C#結(jié)合jQuery進(jìn)行Ajax操作的相關(guān)技巧,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2015-05-05

