C#中GraphicsPath的Warp方法用法實(shí)例
本文實(shí)例講述了C#中GraphicsPath的Warp方法用法。分享給大家供大家參考。具體實(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 Form13 : Form { public Form13() { InitializeComponent(); } private void Form13_Paint(object sender, PaintEventArgs e) { // Create a path and add a rectangle. GraphicsPath myPath = new GraphicsPath(); RectangleF srcRect = new RectangleF(0, 0, 100, 200); myPath.AddRectangle(srcRect); // Draw the source path (rectangle)to the screen. e.Graphics.DrawPath(Pens.Black, myPath); // Create a destination for the warped rectangle. PointF point1 = new PointF(200, 200); PointF point2 = new PointF(400, 250); PointF point3 = new PointF(220, 400); PointF[] destPoints = { point1, point2, point3 }; // Create a translation matrix. Matrix translateMatrix = new Matrix(); translateMatrix.Translate(100, 0); // Warp the source path (rectangle). myPath.Warp(destPoints, srcRect, translateMatrix, WarpMode.Perspective, 0.5f); // Draw the warped path (rectangle) to the screen. e.Graphics.DrawPath(new Pen(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的Widen方法用法實(shí)例
- C#中GraphicsPath的Flatten方法用法實(shí)例
- C#實(shí)現(xiàn)動(dòng)態(tài)數(shù)據(jù)繪圖graphic的方法示例
相關(guān)文章
C# 實(shí)現(xiàn)PPT 每一頁(yè)轉(zhuǎn)成圖片過(guò)程解析
這篇文章主要介紹了C# 實(shí)現(xiàn)PPT 每一頁(yè)轉(zhuǎn)成圖片過(guò)程解析,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2019-09-09C#使用WebService結(jié)合jQuery實(shí)現(xiàn)無(wú)刷新翻頁(yè)的方法
這篇文章主要介紹了C#使用WebService結(jié)合jQuery實(shí)現(xiàn)無(wú)刷新翻頁(yè)的方法,涉及C#中WebService與jQuery操作的相關(guān)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-04-04C#移除字符串中的不可見(jiàn)Unicode字符 案例代碼
最近發(fā)現(xiàn)某個(gè)數(shù)據(jù)采集的系統(tǒng)拿下來(lái)的數(shù)據(jù),有些字段的JSON被莫名截?cái)嗔?,?dǎo)致后續(xù)數(shù)據(jù)分析的時(shí)候解析JSON失敗,這篇文章主要介紹了C#移除字符串中的不可見(jiàn)Unicode字符 ,需要的朋友可以參考下2023-02-02C#實(shí)現(xiàn)大數(shù)字運(yùn)算的實(shí)例代碼
這篇文章介紹了C#實(shí)現(xiàn)大數(shù)字運(yùn)算的實(shí)例代碼,有需要的朋友可以參考一下2013-10-10深入U(xiǎn)nix時(shí)間戳與C# DateTime時(shí)間類型互換的詳解
本篇文章是對(duì)Unix時(shí)間戳與C# DateTime時(shí)間類型互換進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下2013-06-06C#實(shí)現(xiàn)過(guò)濾sql特殊字符的方法集合
這篇文章主要介紹了C#實(shí)現(xiàn)過(guò)濾sql特殊字符的方法,以實(shí)例形式分析總結(jié)了C#針對(duì)SQL危險(xiǎn)字符的幾種常用的過(guò)濾技巧,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2015-11-11C# / VB.NET 在PPT中創(chuàng)建、編輯PPT SmartArt圖形的方法詳解
本文介紹通過(guò)C#和VB.NET程序代碼來(lái)創(chuàng)建和編輯PPT文檔中的SmartArt圖形。文中將分兩個(gè)操作示例來(lái)演示創(chuàng)建和編輯結(jié)果,需要的朋友可以參考下2020-10-10