C#中GraphicsPath的AddString方法用法實例
更新時間:2015年06月12日 14:49:25 作者:zhuzhao
這篇文章主要介紹了C#中GraphicsPath的AddString方法用法,實例分析了AddString方法添加字符串的相關(guān)使用技巧,需要的朋友可以參考下
本文實例講述了C#中GraphicsPath的AddString方法用法。分享給大家供大家參考。具體如下:
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 Form14 : Form { public Form14() { InitializeComponent(); } private void Form14_Paint(object sender, PaintEventArgs e) { // Create a GraphicsPath object. GraphicsPath myPath = new GraphicsPath(); // Set up all the string parameters. string stringText = "Sample Text"; FontFamily family = new FontFamily("Arial"); int fontStyle = (int)FontStyle.Italic; int emSize = 26; Point origin = new Point(20, 20); StringFormat format = StringFormat.GenericDefault; // Add the string to the path. myPath.AddString(stringText, family, fontStyle, emSize, origin, format); //Draw the path to the screen. e.Graphics.FillPath(Brushes.Black, myPath); } } }
希望本文所述對大家的C#程序設(shè)計有所幫助。
您可能感興趣的文章:
- C#實現(xiàn)Windows Form調(diào)用R進行繪圖與顯示的方法
- C#打印繪圖的實現(xiàn)方法
- C# GDI在控件上繪圖的方法
- 混合語言編程—C#使用原生的Directx和OpenGL繪圖的方法
- 深入c# GDI+簡單繪圖的具體操作步驟(四)
- 深入c# GDI+簡單繪圖的具體操作步驟(三)
- 深入c# GDI+簡單繪圖的具體操作步驟(二)
- 深入c# GDI+簡單繪圖的具體操作步驟(一)
- C#中GraphicsPath的Warp方法用法實例
- C#中GraphicsPath的Widen方法用法實例
- C#中GraphicsPath的Flatten方法用法實例
- C#實現(xiàn)動態(tài)數(shù)據(jù)繪圖graphic的方法示例
相關(guān)文章
C# 刪除數(shù)組內(nèi)的某個值、一組值方法詳解
在本篇文章里小編給大家整理的是關(guān)于C# 如何刪除數(shù)組內(nèi)的某個值、一組值的相關(guān)知識點,需要的朋友們學習下。2020-03-03解決C#中WebBrowser的DocumentCompleted事件不執(zhí)行的實現(xiàn)方法
本篇文章是對C#中WebBrowser的DocumentCompleted事件不執(zhí)行解決方法進行了詳細的分析介紹,需要的朋友參考下2013-05-05C# 16進制與字符串、字節(jié)數(shù)組之間的轉(zhuǎn)換
在串口通訊過程中,經(jīng)常要用到 16進制與字符串、字節(jié)數(shù)組之間的轉(zhuǎn)換2009-05-05