2个回答
展开全部
以下代码把picture1控件做成200x200的圆(圆的大小可以从参数中改)
有问题消息我
Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long '创建一个椭圆,该椭圆与X1,Y1和X2,Y2坐标点确定的矩形内切
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long '改变窗口的区域
Private Sub Form_Load()
Dim mianji As Long
mianji = CreateEllipticRgn(0, 0, 200, 200)
SetWindowRgn Picture1.hWnd, mianji, True
End Sub
有问题消息我
Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long '创建一个椭圆,该椭圆与X1,Y1和X2,Y2坐标点确定的矩形内切
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long '改变窗口的区域
Private Sub Form_Load()
Dim mianji As Long
mianji = CreateEllipticRgn(0, 0, 200, 200)
SetWindowRgn Picture1.hWnd, mianji, True
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询