本文整理汇总了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