⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 transform.vb

📁 Samples are organized by chapter, and then by "application" or example name. You should open a proje
💻 VB
字号:
Public Class Transform
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        '
        'Transform
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(292, 266)
        Me.Name = "Transform"
        Me.Text = "Translate Transform"

    End Sub

#End Region

    Private Sub Transform_Paint(ByVal sender As Object, _
      ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint

        ' Draw several squares in different places.
        DrawRectangle(e.Graphics)
        e.Graphics.TranslateTransform(180, 60)
        DrawRectangle(e.Graphics)
        e.Graphics.TranslateTransform(-50, 80)
        DrawRectangle(e.Graphics)
        e.Graphics.TranslateTransform(-100, 50)
        DrawRectangle(e.Graphics)

    End Sub

    Private Sub DrawRectangle(ByVal g As Graphics)
        Dim DrawingPen As New Pen(Color.Red, 30)

        ' Draw a rectangle at a fixed position.
        g.DrawRectangle(DrawingPen, New Rectangle(20, 20, 20, 20))
    End Sub

End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -