Public Class Form1
Dim BMP As Bitmap
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim X As Integer
Dim Y As Integer
BMP = New Bitmap(250, 48)
Dim GF As Graphics = Me.CreateGraphics
Dim GB As Graphics = Graphics.FromImage(BMP)
GB.FillRectangle(Brushes.White, 0, 0, 250, 48)
GB.DrawString("VB研究小站", New Font("標楷體", 28, FontStyle.Bold), Brushes.Black, 0, 0)
For X = 0 To 249
For Y = 0 To 47
If BMP.GetPixel(X, Y) <> Color.FromArgb(255, 255, 255, 255) Then
BMP.SetPixel(X, Y, Color.FromArgb(255, 250 - X, 15, X))
End If
Next
Next
GF.DrawImage(BMP, 0, 0)
GF.Dispose()
GB.Dispose()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
沒有留言:
張貼留言