|
|
|
|
|
Dicas
|
|
Visual Basic (Forms/MDI)
|
|
|
Título da Dica: Deixando o formulário com o formato de um estrela
|
|
|
|
Postada em 31/7/2003 por Tekki
'Declare Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long Private Type POINTAPI X As Long Y As Long End Type
'No Form Private Sub Form_Load()
Const PI = 3.14159265 Const NUM_PTS = 26 Const R1x = 100 Const R2x = 200 Const R1y = 75 Const R2y = 150
Dim i As Integer Dim cx As Integer Dim cy As Integer Dim points() As POINTAPI Dim theta As Single Dim dtheta As Single Dim rgn As Long ReDim points(0 To NUM_PTS - 1) cx = R2x cy = R2y dtheta = 2 * PI / NUM_PTS theta = PI / 2 For i = 0 To NUM_PTS / 2 - 1 points(i * 2).X = cx + R1x * Cos(theta) points(i * 2).Y = cy + R1y * Sin(theta) theta = theta + dtheta points(i * 2 + 1).X = cx + R2x * Cos(theta) points(i * 2 + 1).Y = cy + R2y * Sin(theta) theta = theta + dtheta Next i rgn = CreatePolygonRgn(points(0), NUM_PTS, 1) SetWindowRgn hWnd, rgn, True End Sub
|
|
|
|
|