您的位置:首页 > 编程语言

输出无边界的空心字(代码)

2004-09-11 09:50 316 查看
Private Declare Function BeginPath Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function EndPath Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function PathToRegion Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long

Private Sub Form_Load()
    Dim hRgn As Long
    Me.WindowState = 2
    Me.FontName = "Arial"
    Me.FontSize = 100
    Me.BackColor = vbRed
    BeginPath Me.hdc
    TextOut Me.hdc, 0, 0, "I love you !", 12
    EndPath Me.hdc
    hRgn = PathToRegion(Me.hdc)
    SetWindowRgn Me.hWnd, hRgn, True
    DeleteObject hRgn
End Sub
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  function string user
相关文章推荐