picture1.picture=loadpicture ("c:\мои документы\картинка.bmp"
Private Const SRCPAINT& = &HEE0086
Private Const SRCCOPY& = &HCC0020
Private Const SRCAND& = &H8800C6
Private Const SRCERASE& = &H440328
Private Const SRCINVERT& = &H660046
Private Const TRANSPARENT& = 1
Private Const RGN_COPY& = 5
Private Const RGN_AND& = 1
Private Const RGN_DIFF& = 4
Private Const RGN_XOR& = 3
Private Const RGN_OR& = 2
Private Const BLACK_BRUSH = 4
Private Const BLACK_PEN = 7
Private Const PS_SOLID = 0
Private Const PS_DASH = 1 ' -------
Private Const PS_DOT = 2 ' .......
Private Const PS_DASHDOT = 3 ' _._._._
Private Const PS_DASHDOTDOT = 4 ' _.._.._
Private Const PS_NULL = 5
Private Const PS_INSIDEFRAME = 6
Private Const PS_USERSTYLE = 7
Private Const PS_ALTERNATE = 8
Private Const PS_STYLE_MASK = &HF
Private Declare Function SaveDC Lib "gdi32" _
(ByVal hdc As Long) As Long
Private Declare Function RestoreDC Lib "gdi32" _
(ByVal hdc As Long, ByVal nSavedDC As Long) As Long
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 SelectClipPath Lib "gdi32" _
(ByVal hdc As Long, ByVal iMode As Long) As Long
Private Declare Function SelectClipRgn Lib "gdi32" _
(ByVal hdc As Long, ByVal hRgn As Long) As Long
Dim Res As Long
Dim Sav As Long
Sav = SaveDC(picOut.hdc)
Call SelectClipRgn(picOut.hdc, 0)
Res = BeginPath(picOut.hdc)
picOut.Circle (100, 100), 40, vbBlack
Res = EndPath(picOut.hdc)
Res = SelectClipPath(picOut.hdc, RGN_COPY)
Call picOut.PaintPicture(picBG.Picture, _
40, 55, picBG.ScaleWidth, _
picBG.ScaleHeight, 0, 0, _
picBG.ScaleWidth, picBG.ScaleHeight)
Res = RestoreDC(picOut.hdc, Sav)
Private Sub Form_Load()
'Инициализация раскрывающегося списка lst1
lst1.AddItem "1 - Oval"
lst1.AddItem "2 - Square"
'Инициализация раскрывающегося списка lst2
lst2.AddItem "1 - Solid"
lst2.AddItem "2 - Transparent"
lst2.AddItem "3 - Horizontal Line"
lst2.AddItem "4 - Vertical Line"
lst2.AddItem "5 - Cross"
'Установим начальные значения для каждого сиска
lst1.ListIndex = 0
lst2.ListIndex = 0
Потом нажми два раза на lst2 и в правом раскрывающемся окне выбери событие Click и пеши такои код:
'Изменить вид в соответствии с выбором
Private Sub lst2_Click()
shpSample.FillStyle = lst2.ListIndex
End Sub
Сделаи ту же операцию что и в первом , правом раскрывающемся окне выбери событие Click!
Private Sub lst1_Click()
shpSample.Shape = lst1.ListIndex
End Sub
Сейчас этот форум просматривают: Google-бот и гости: 90