Лабораторная работа: Creating graphic editor
Case 4
If BoxOptionInterior(0).Value = True Then MainPic. Line (XX, YY) – (XX2, YY2), FirstColor, BF
If BoxOptionInterior(1).Value = True Then MainPic. Line (XX, YY) – (XX2, YY2), SecondColor, BF
If BoxOptionInterior(3).Value = True Then MainPic. Line (XX, YY) – (XX2, YY2), &HFFFFFF, BF
MainPic. Line (XX, YY) – (XX2, YY2), FirstColor, B
Shape2. Visible = False
Case 5
Rad = IIf (Abs(YY2 – YY) > Abs (XX2 – XX), Abs (YY2 – YY) / 2, Abs (XX2 – XX) / 2)
If XX2 <> XX Then MainPic. Circle ((XX2 + XX) / 2, (YY2 + YY) / 2), Rad, FirstColor, Abs (YY2 – YY) / Abs (XX2 – XX)
Shape2. Visible = False
Case 8
Dim sc1 As Long
Dim sc2 As Long
sc1 = FirstColor
If GradationColor(0).Value = True Then sc2 = SecondColor
If GradationColor(1).Value = True Then sc2 = &HFFFFFF
If GradationColor(2).Value = True Then sc2 = &H0
f1 = TakeRGB (sc2, 0): f2 = TakeRGB (sc2, 1): f3 = TakeRGB (sc2, 2)
v1 = TakeRGB (sc1, 0): v2 = TakeRGB (sc1, 1): v3 = TakeRGB (sc1, 2)
forstep = 10
If XX2 < XX Then xx3 = XX: XX = XX2: XX2 = xx3
If YY2 < YY Then yy3 = YY: YY = YY2: YY2 = yy3
ForStart = IIf (GradationDirection(0).Value = True, XX, YY)
Endpro = IIf (GradationDirection(0).Value = True, XX2, YY2)
For i = ForStart To Endpro Step forstep
D1 = v1 + (f1 – v1) / (Endpro – ForStart) * (i – ForStart)
D2 = v2 + (f2 – v2) / (Endpro – ForStart) * (i – ForStart)
D3 = v3 + (f3 – v3) / (Endpro – ForStart) * (i – ForStart)
If GradationDirection(0).Value = True Then MainPic. Line (i, YY) – (i, YY2), RGB (D1, D2, D3)