Как скомбинировать 6 регионов? - VB
Формулировка задачи:
Скажите, пожалуйста, как скомбинировать 6 регионов.
Решение задачи: «Как скомбинировать 6 регионов?»
textual
Листинг программы
Option Explicit 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 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 OffsetRgn Lib "gdi32" (ByVal hRgn As Long, ByVal x As Long, ByVal y As Long) As Long Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long Private Const RGN_OR As Long = 2 Private Const RGN_XOR As Long = 3 Private Sub Form_Load() Dim hRgn1 As Long Dim hRgn2 As Long ScaleMode = vbPixels hRgn1 = CreateEllipticRgn(0, 0, ScaleWidth \ 2, ScaleHeight \ 2) hRgn2 = CreateEllipticRgn(ScaleWidth \ 2, 0, ScaleWidth, ScaleHeight \ 2) CombineRgn hRgn1, hRgn1, hRgn2, RGN_OR OffsetRgn hRgn2, 0, ScaleHeight \ 2 CombineRgn hRgn1, hRgn1, hRgn2, RGN_OR OffsetRgn hRgn2, -ScaleWidth \ 2, 0 CombineRgn hRgn1, hRgn1, hRgn2, RGN_OR OffsetRgn hRgn2, 0, -ScaleHeight \ 4 CombineRgn hRgn1, hRgn1, hRgn2, RGN_XOR OffsetRgn hRgn2, ScaleWidth \ 2, 0 CombineRgn hRgn1, hRgn1, hRgn2, RGN_XOR SetWindowRgn hWnd, hRgn1, True DeleteObject hRgn2 End Sub
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д