我正在使用VB6。谁能告诉我如何制作圆形圆形?
我使用过此代码,但显示错误:
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode 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 Function fMakeATranspArea(AreaType As String, pCordinate() As Long) As Boolean
答案 0 :(得分:2)
fMakeATranspArea
也可能看起来像是API调用(事实并非如此) - 但它缺少了正文,这可能是您感到困惑的问题。
您可以使用以下手册替换最后一行:
Private Sub Form_Load()
SetWindowRgn Me.hWnd, CreateEllipticRgn(0, 0, 300, 300), 1
End Sub
你看到的那些数字是坐标。我不建议您修复fMakeATranspArea
,因为它似乎很复杂,并且过于复杂化了您可能需要的内容。
CombineRgn
和CreateRectRgn
在这种情况下也是不需要的。
从它的外观来看,你从这里找到了源代码 - 它有完整的实现:
http://www.planet-source-code.com/vb/scripts/ShowCodeAsText.asp?txtCodeId=1617&lngWId=-10