国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > C# > 正文

C#中GraphicsPath的Warp方法用法實例

2020-01-24 01:44:26
字體:
來源:轉載
供稿:網友

本文實例講述了C#中GraphicsPath的Warp方法用法。分享給大家供大家參考。具體實現方法如下:

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);    }  }}

希望本文所述對大家的C#程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 清苑县| 玉田县| 饶河县| 扎鲁特旗| 房山区| 侯马市| 永州市| 三河市| 凤山县| 碌曲县| 正镶白旗| 多伦县| 乐业县| 稷山县| 宜黄县| 巴塘县| 甘孜| 谢通门县| 璧山县| 巩留县| 奉新县| 慈利县| 紫金县| 赫章县| 漾濞| 临高县| 汶上县| 清徐县| 新晃| 鄂尔多斯市| 呼图壁县| 年辖:市辖区| 宜章县| 海南省| 永寿县| 水城县| 遂平县| 永嘉县| 武胜县| 唐河县| 天长市|