📄 form1.vb
字号:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写 dispose 以清理组件列表。
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
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
Friend WithEvents Panel1 As System.Windows.Forms.Panel
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Panel1 = New System.Windows.Forms.Panel
Me.SuspendLayout()
'
'Panel1
'
Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
Me.Panel1.Location = New System.Drawing.Point(0, 0)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(292, 266)
Me.Panel1.TabIndex = 0
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.Add(Me.Panel1)
Me.Name = "Form1"
Me.Text = "百叶窗"
Me.ResumeLayout(False)
End Sub
#End Region
Dim h, w As Integer
Dim g As Image
Dim pic1, pic2 As Bitmap
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim g1 As Bitmap
h = Panel1.Height
w = Panel1.Width
g = Image.FromFile("sunset.jpg")
g1 = New Bitmap(g, w, h)
Panel1.BackgroundImage = g1
End Sub
Private Sub Panel1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint
Dim g2 As Graphics = e.Graphics
Dim col As Color = New Color
Dim i, j, k As Integer
Panel1.BackgroundImage = Nothing
pic1 = New Bitmap(g, w, h)
pic2 = New Bitmap(w, h)
For i = 0 To 8
For j = i To h - 1 Step 10
For k = 0 To w - 1
col = pic1.GetPixel(k, j)
pic2.SetPixel(k, j, col)
Next
Next
g2.DrawImage(pic2, 0, 0)
zhanting()
Next
End Sub
Private Sub zhanting()
Dim i As Integer
For i = 0 To 100000000
If i < 100000000 Then
End If
Next
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -