本文整理匯總了VB.NET中System.Drawing.Drawing2D.GraphicsPath.Warp方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET GraphicsPath.Warp方法的具體用法?VB.NET GraphicsPath.Warp怎麽用?VB.NET GraphicsPath.Warp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。
在下文中一共展示了GraphicsPath.Warp方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: WarpExample
Public Sub WarpExample(ByVal e As PaintEventArgs)
' Create a path and add a rectangle.
Dim myPath As New GraphicsPath
Dim srcRect As 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.
Dim point1 As New PointF(200, 200)
Dim point2 As New PointF(400, 250)
Dim point3 As New PointF(220, 400)
Dim destPoints As PointF() = {point1, point2, point3}
' Create a translation matrix.
Dim translateMatrix As 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)
End Sub