當前位置: 首頁>>代碼示例>>VB.NET>>正文


VB.NET Graphics.BeginContainer方法代碼示例

本文整理匯總了VB.NET中System.Drawing.Graphics.BeginContainer方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET Graphics.BeginContainer方法的具體用法?VB.NET Graphics.BeginContainer怎麽用?VB.NET Graphics.BeginContainer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Drawing.Graphics的用法示例。


在下文中一共展示了Graphics.BeginContainer方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。

示例1: BeginContainerVoid

Private Sub BeginContainerVoid(ByVal e As PaintEventArgs)

    ' Begin graphics container.
    Dim containerState As GraphicsContainer = _
    e.Graphics.BeginContainer()

    ' Translate world transformation.
    e.Graphics.TranslateTransform(100.0F, 100.0F)

    ' Fill translated rectangle in container with red.
    e.Graphics.FillRectangle(New SolidBrush(Color.Red), 0, 0, 200, 200)

    ' End graphics container.
    e.Graphics.EndContainer(containerState)

    ' Fill untransformed rectangle with green.
    e.Graphics.FillRectangle(New SolidBrush(Color.Green), 0, 0, _
    200, 200)
End Sub
開發者ID:VB.NET開發者,項目名稱:System.Drawing,代碼行數:19,代碼來源:Graphics.BeginContainer

示例2: BeginContainerRectangle

Private Sub BeginContainerRectangle(ByVal e As PaintEventArgs)

    ' Define transformation for container.
    Dim srcRect As New Rectangle(0, 0, 200, 200)
    Dim destRect As New Rectangle(100, 100, 150, 150)

    ' Begin graphics container.
    Dim containerState As GraphicsContainer = _
    e.Graphics.BeginContainer(destRect, srcRect, GraphicsUnit.Pixel)

    ' Fill red rectangle in container.
    e.Graphics.FillRectangle(New SolidBrush(Color.Red), 0, 0, 200, 200)

    ' End graphics container.
    e.Graphics.EndContainer(containerState)

    ' Fill untransformed rectangle with green.
    e.Graphics.FillRectangle(New SolidBrush(Color.Green), 0, 0, _
    200, 200)
End Sub
開發者ID:VB.NET開發者,項目名稱:System.Drawing,代碼行數:20,代碼來源:Graphics.BeginContainer

示例3: BeginContainerRectangleF

Private Sub BeginContainerRectangleF(ByVal e As PaintEventArgs)

    ' Define transformation for container.
    Dim srcRect As New RectangleF(0.0F, 0.0F, 200.0F, 200.0F)
    Dim destRect As New RectangleF(100.0F, 100.0F, 150.0F, 150.0F)

    ' Begin graphics container.
    Dim containerState As GraphicsContainer = _
    e.Graphics.BeginContainer(destRect, srcRect, GraphicsUnit.Pixel)

    ' Fill red rectangle in container.
    e.Graphics.FillRectangle(New SolidBrush(Color.Red), 0.0F, 0.0F, _
    200.0F, 200.0F)

    ' End graphics container.
    e.Graphics.EndContainer(containerState)

    ' Fill untransformed rectangle with green.
    e.Graphics.FillRectangle(New SolidBrush(Color.Green), 0.0F, 0.0F, _
    200.0F, 200.0F)
End Sub
開發者ID:VB.NET開發者,項目名稱:System.Drawing,代碼行數:21,代碼來源:Graphics.BeginContainer


注:本文中的System.Drawing.Graphics.BeginContainer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。