CREATING GRAPHIC EDITOR
On Visual Basic
Main INTERFACE
Source Code:
Dim EraserColor As Long
Dim EraserSize As Integer
Dim PencilSize As Integer
Dim BoxInversed As Boolean
Dim GradationChanged As Boolean
Dim XX As Double, YY As Double
Dim XX2 As Double, YY2 As Double
Dim CurrentChoice
Dim TheColor As Long
Dim Red As Long
Dim Green As Long
Dim Blue As Long
Dim SecondColor As Long
Dim FirstColor As Long
Private Sub BoxOptionInterior_Click (Index As Integer)
BoxOptionSample. BackStyle = IIf (Index = 2, 0, 1)
If Index = 0 Then BoxOptionSample. BackColor = FirstColor
If Index = 1 Then BoxOptionSample. BackColor = SecondColor
If Index = 3 Then BoxOptionSample. BackColor = &HFFFFFF
End Sub
Private Sub ColorBoard_MouseMove (Button As Integer, Shift As Integer, x As Single, y As Single)
On Error GoTo 10
TheColor = ColorBoard. Point (x, y)
If Button <> 1 And Button <> 2 Then Exit Sub
If Button = 1 Then ForeColorSample. BackColor = TheColor: FirstColor = TheColor: g = 0
If Button = 2 Then BackColorSample. BackColor = TheColor: SecondColor = TheColor: g = 3
Scroll(g).Value = TakeRGB (TheColor, 0): Scroll (g + 1).Value = TakeRGB (TheColor, 1): Scroll (g + 2).Value = TakeRGB (TheColor, 2)
10 End Sub
Private Sub Command1_Click()
f$ = InputBox («Input the size of the eraser», «Drawer V1.0», EraserOptionText. Text)
f$ = RTrim$(LTrim$(f$))
If «» + f$ <> Str$(Val (f$)) Then MsgBox «Input error!», vbOKOnly, «Drawer V1.0»: Exit Sub
If Val (f$) <> Int (Val(f$)) Then MsgBox «Input error!», vbOKOnly, «Drawer V1.0»: Exit Sub
If Val (f$) > 500 Or Val (f$) < 100 Then MsgBox «Input error!», vbOKOnly, «Drawer V1.0»: Exit Sub
EraserOptionText. Text = f$
EraserSize = Val (f$)
Shape3. Width = Val (f$): Shape3. Height = Val (f$)
Shape1. Width = Val (f$): Shape1. Height = Val (f$)
End Sub
Private Sub Command2_Click()
f$ = InputBox («Input the border of the line or pencil», «Drawer V1.0», LineOptionText. Text)
f$ = RTrim$(LTrim$(f$))
If «» + f$ <> Str$(Val (f$)) Then MsgBox «Input error!», vbOKOnly, «Drawer V1.0»: Exit Sub
If Val (f$) <> Int (Val(f$)) Then MsgBox «Input error!», vbOKOnly, «Drawer V1.0»: Exit Sub
If Val (f$) > 10 Or Val (f$) < 1 Then MsgBox «Input error!», vbOKOnly, «Drawer V1.0»: Exit Sub
LineOptionText. Text = f$
PencilSize = Val (f$)
Line2. BorderWidth = Val (f$)
End Sub
Private Sub DialogBox_Click (Index As Integer)
Static coloring As Long
On Error GoTo 100
CommonDialog1. ShowColor
coloring = CommonDialog1. Color
Scroll (Index * 3).Value = TakeRGB (coloring, 0)
Scroll (Index * 3 + 1).Value = TakeRGB (coloring, 1)
Scroll (Index * 3 + 2).Value = TakeRGB (coloring, 2)
100
End Sub
Private Sub EraserOptionColor_Click (Index As Integer)
EraserColor = IIf (Index = 0, SecondColor, &HFFFFFF)
End Sub
Private Sub EraserOptionText_GotFocus()
Command1. SetFocus
End Sub
Private Sub Form_Load()
EraserColor = &HFFFFFF
PencilSize = 1
EraserSize = 300
CurrentChoice = 1
FirstColor = &H0
SecondColor = &HFFFFFF
End Sub
Private Sub Form_MouseMove (Button As Integer, Shift As Integer, x As Single, y As Single)
Shape1. Visible = False
End Sub
Private Sub GradationColor_Click (Index As Integer)
GradationChanged = True
End Sub
Private Sub GradationDirection_Click (Index As Integer)
GradationChanged = True
End Sub
Private Sub LineOptionText_GotFocus()
Command2. SetFocus
End Sub
Private Sub MainPic_MouseDown (Button As Integer, Shift As Integer, x As Single, y As Single)
If Button <> 1 Then Exit Sub
Select Case CurrentChoice
Case 1
Line1.X1 = x: Line1.X2 = x
Line1.Y1 = y: Line1.Y2 = y
Line1. Visible = True
Case 2
XX = x: YY = y
Case 3
MainPic. Line (Shape1. Left, Shape1. Top) – (Shape1. Left + Shape1. Width, Shape1. Top + Shape1. Width), EraserColor, BF
Case 4, 5, 8
XX = x: YY = y
XX2 = x: YY2 = y
Shape2. Shape = IIf (CurrentChoice = 5, 2, 0)
Shape2. Visible = True
Shape2. Left = x: Shape2. Top = y
Shape2. Width = 0: Shape2. Height = 0
End Select
End Sub
Private Sub MainPic_MouseMove (Button As Integer, Shift As Integer, x As Single, y As Single)
If CurrentChoice = 3 Then
Shape1. Left = x – Shape1. Width / 2
Shape1. Top = y – Shape1. Width / 2
Shape1. Visible = True
End If
If Button <> 1 Then GoTo 10
Select Case CurrentChoice
Case 1
Line1.X2 = x: Line1.Y2 = y
Case 2
MainPic. DrawWidth = PencilSize
MainPic. Line (XX, YY) – (x, y), FirstColor: XX = x: YY = y
MainPic. DrawWidth = 1
Case 3
MainPic. Line (Shape1. Left, Shape1. Top) – (Shape1. Left + Shape1. Width, Shape1. Top + Shape1. Width), EraserColor, BF
Case 4, 5, 8
XX2 = x: YY2 = y
Shape2. Left = IIf (x > XX, XX, x)
Shape2. Top = IIf (y > YY, YY, y)
Shape2. Width = Abs (x – XX)
Shape2. Height = Abs (y – YY)
Case 6
Scroll(0).Value = TakeRGB (MainPic. Point (x, y), 0)
Scroll(1).Value = TakeRGB (MainPic. Point (x, y), 1)
Scroll(2).Value = TakeRGB (MainPic. Point (x, y), 2)
End Select
Exit Sub
... того пользователь имеет возможность задать любые атрибуты по формату <имя атрибута>=<значение>Допускается рекурсия атрибутов. Этапы создания графической схем в системе автоматизированнного проектирования OrCAD Графический редактор Schematics пакета Design Center 6.2 на платформе Windows позволяет создавать чертежи принципиальных схем и передавать управление программам PSpice, ...
... программирование микроконтроллера, как инструмента накопления данных и управления ресурсами, с учётом необходимой и достаточной степени доступа к конечной аппаратуре. Модуль накопления для задач многомерной мессбауэровской спектрометрии спроектирован с учётом следующих условий: - Синхронизация накопителя с системой доплеровской модуляции осуществляется внешними тактовыми импульсами “старт” и ...
... за фахом 14.01.25 - судова медицина. - Національна медична академія післядипломної освіти імені П.Л. Шупика, Київ, 2008. Вивчали можливості використання смартфонів і комунікаторів в судово-медичній експертизі. За допомогою смартфона створено 31 оригінальну судово-медичну комп’ютерну програму для їх використання при експрес-діагностиці часу настання смерті, странгуляції, автомобільній травмі і ...
of promoting a morpheme is its repetition. Both root and affixational morphemes can be emphasized through repetition. Especially vividly it is observed in the repetition of affixational morphemes which normally carry the main weight of the structural and not of the denotational significance. When repeated, they come into the focus of attention and stress either their logical meaning (e.g. that of ...
0 комментариев