本文整理匯總了VB.NET中System.Drawing.Graphics.TranslateClip方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET Graphics.TranslateClip方法的具體用法?VB.NET Graphics.TranslateClip怎麽用?VB.NET Graphics.TranslateClip使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Drawing.Graphics
的用法示例。
在下文中一共展示了Graphics.TranslateClip方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: TranslateClipInt
Private Sub TranslateClipInt(ByVal e As PaintEventArgs)
' Create rectangle for clipping region.
Dim clipRect As New Rectangle(0, 0, 100, 100)
' Set clipping region of graphics to rectangle.
e.Graphics.SetClip(clipRect)
' Translate clipping region.
Dim dx As Integer = 50
Dim dy As Integer = 50
e.Graphics.TranslateClip(dx, dy)
' Fill rectangle to demonstrate translated clip region.
e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
500, 300)
End Sub
示例2: TranslateClipFloat
Private Sub TranslateClipFloat(ByVal e As PaintEventArgs)
' Create rectangle for clipping region.
Dim clipRect As New RectangleF(0.0F, 0.0F, 100.0F, 100.0F)
' Set clipping region of graphics to rectangle.
e.Graphics.SetClip(clipRect)
' Translate clipping region.
Dim dx As Single = 50.0F
Dim dy As Single = 50.0F
e.Graphics.TranslateClip(dx, dy)
' Fill rectangle to demonstrate translated clip region.
e.Graphics.FillRectangle(New SolidBrush(Color.Black), 0, 0, _
500, 300)
End Sub