Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
Private Sub OpacityTimer_Tick(sender As Object, e As EventArgs) Handles opacityTimer.Tick
Me.Opacity -= opacityStep
If Me.Opacity <= 0.0 Then
opacityTimer.Stop()
Me.Close()
End If
End Sub
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms
Public Class MainForm
Inherits Form
Private WithEvents opacityTimer As Timer
Private opacityStep As Double = 0.1
Private fadeInterval As Integer = 100
Public Sub New()
Me.Text = "绘制SP图案"
Me.Size = New Size(500, 300)
Me.FormBorderStyle = FormBorderStyle.None ' 禁用窗口边框
Dim path As New GraphicsPath()
Dim radius As Integer = 50 ' 增加圆角的半径
Dim rect As New Rectangle(0, 0, Me.Width, Me.Height)
path.AddArc(rect.X, rect.Y, radius, radius, 180, 90) ' 左上角
path.AddArc(rect.Width - radius, rect.Y, radius, radius, 270, 90) ' 右上角
path.AddArc(rect.Width - radius, rect.Height - radius, radius, radius, 0, 90) ' 右下角
path.AddArc(rect.X, rect.Height - radius, radius, radius, 90, 90) ' 左下角
path.CloseFigure()
Me.Region = New Region(path)
opacityTimer = New Timer()
opacityTimer.Interval = fadeInterval
opacityTimer.Start()
End Sub
Protected Overrides Sub OnPaintBackground(e As PaintEventArgs)
Dim graphics = e.Graphics
graphics.SmoothingMode = SmoothingMode.AntiAlias ' 启用抗锯齿
graphics.Clear(Color.White) ' 设置窗口背景颜色
End Sub
Private Sub OpacityTimer_Tick(sender As Object, e As EventArgs) Handles opacityTimer.Tick
Me.Opacity -= opacityStep
If Me.Opacity <= 0.0 Then
opacityTimer.Stop()
Me.Close()
End If
End Sub
Public Shared Sub Main()
Application.Run(New MainForm())
End Sub
End Class
Public Class MainForm
’ Inherits Form
Private WithEvents opacityTimer As Timer
Private opacityStep As Double = 0.1
Private fadeInterval As Integer = 100
Public Sub New()
Me.Text = "绘制SP图案"
Me.Size = New Size(500, 300)
Me.FormBorderStyle = FormBorderStyle.None ' 禁用窗口边框
Dim path As New GraphicsPath()
Dim radius As Integer = 50 ' 增加圆角的半径
Dim rect As New Rectangle(0, 0, Me.Width, Me.Height)
path.AddArc(rect.X, rect.Y, radius, radius, 180, 90) ' 左上角
path.AddArc(rect.Width - radius, rect.Y, radius, radius, 270, 90) ' 右上角
path.AddArc(rect.Width - radius, rect.Height - radius, radius, radius, 0, 90) ' 右下角
path.AddArc(rect.X, rect.Height - radius, radius, radius, 90, 90) ' 左下角
path.CloseFigure()
Me.Region = New Region(path)
opacityTimer = New Timer()
opacityTimer.Interval = fadeInterval
opacityTimer.Start()
End Sub
Protected Overrides Sub OnPaintBackground(e As PaintEventArgs)
Dim graphics = e.Graphics
graphics.SmoothingMode = SmoothingMode.AntiAlias ' 启用抗锯齿
graphics.Clear(Color.White) ' 设置窗口背景颜色
End Sub
Private Sub OpacityTimer_Tick(sender As Object, e As EventArgs) Handles opacityTimer.Tick
Me.Opacity -= opacityStep
If Me.Opacity <= 0.0 Then
opacityTimer.Stop()
Me.Close()
End If
End Sub
Public Shared Sub Main()
Application.Run(New MainForm())
End Sub
End Class
’ Inherits Form