Convert forms into the shape of the text
Convert forms into the shape of the text
API Declarations
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 SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Const RGN_COPY = 5
Rate Convert forms into the shape of the text
(2(2 Vote))
Const txt = "Bedazzled"
Dim hRgn As Long
BorderStyle = vbBSNone
Caption = ""
BackColor = &H80000001
' big font.
Font.Name = "Comic Sans MS"
Font.Bold = True
Font.Size = 50
' form big enough.
Width = TextWidth(txt)
Height = TextHeight(txt)
' clipping path.
BeginPath hDC
CurrentX = 0
CurrentY = 0
Print txt
EndPath hDC
hRgn = PathToRegion(hDC)
SetWindowRgn hwnd, hRgn, False
' Position the form.
Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2
Convert forms into the shape of the text Comments
No comments yet — be the first to post one!
Post a Comment