2017年12月12日 星期二

[ VB2010 ] - 文字抹上漸層色

[ VB2010 ] - 文字抹上漸層色



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

沒有留言:

張貼留言

2024年4月24日 星期三 Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --2

 2024年4月24日 星期三 Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --2 AngularJS 實例 <!DOCTYPE html> <html> <head> &...