日期:2008-10-25 浏览次数:20410 次
Private Sub frmMain_Paint( _ ByVal sender As Object, _ ByVal e As PaintEventArgs) _ Handles MyBase.Paint Dim path As New GraphicsPath() Dim pt As New PointF() Dim rct As Rectangle = Me.ClientRectangle path.AddRectangle(rct) Dim pgb As New PathGradientBrush(path) pt = New PointF( _ CType(Me.ClientSize.Width / 2, Single), _ CType(Me.ClientSize.Height / 2, Single)) pgb.CenterPoint = pt Dim Colors() As Color = _ {Color.Red, Color.Orange, Color.Yellow, _ Color.Green, _ Color.Blue, Color.Indigo, Color.Violet} Dim Positions() As Single = _ {0.0, 0.1, 0.2, 0.4, 0.6, 0.8, 1} Dim cb As ColorBlend = New ColorBlend() cb.Colors = Colors cb.Positions = Positions pgb.InterpolationColors = cb e.Graphics.FillRectangle(pgb, rct) Dim f As New StringFormat() f.Alignment = StringAlignment.Center e.Graphics.DrawString( _ Date.Now.ToLongTimeString, _ New Font("Tahoma", 13), Brushes.White, pt, f)End Sub
免责声明: 本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
|