Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Ruggy Paint 2 - Form1.frm

Form1.frm

Caricato da: Ruggy94
Scarica il programma completo

  1. Option Explicit
  2. Dim raggp As Boolean
  3. Dim xragg As Single
  4. Dim yragg As Single
  5. Dim pirp As Boolean
  6. Dim xpir As Single
  7. Dim ypir As Single
  8. Dim col
  9.  
  10. Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
  11.  
  12. Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
  13. Const VK_SNAPSHOT As Byte = &H2C
  14.  
  15. Dim mx As Long
  16. Dim my As Long
  17.  
  18. Dim xc As Single
  19. Dim yc As Single
  20.  
  21. Dim xc2 As Single
  22. Dim yc2 As Single
  23.  
  24. Private Sub mnguida_Click()
  25. Dim Shell As Object
  26. Set Shell = CreateObject("Shell.Application")
  27. Shell.Open App.Path & "\" & "Help.txt"
  28. End Sub
  29.  
  30. Private Sub prelev_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  31. prelev.Appearance = 1
  32. rettangolo.Appearance = 0
  33. cerchio.Appearance = 0
  34. pennello.Appearance = 0
  35. puntatore.Appearance = 0
  36. Picture1.DrawWidth = CInt(Text1.Text)
  37. matita.Appearance = 0
  38. rettangolor.Appearance = 0
  39. raggp = False
  40. piramide.Appearance = 0
  41. pirp = False
  42. ragg.Appearance = 0
  43. rettangolox.Appearance = 0
  44. linea.Appearance = 0
  45. gomma.Appearance = 0
  46. Picture1.MouseIcon = LoadPicture("")
  47. Picture1.MousePointer = 2
  48. End Sub
  49.  
  50. Private Sub rand_Click()
  51. Dim min As Integer
  52. Dim xmax As Integer
  53. Dim ymax As Integer
  54. Dim xext As Single
  55. Dim xext2 As Single
  56. Dim yext As Single
  57. Dim yext2 As Single
  58. Dim X As Integer
  59. min = 2
  60. xmax = 1154
  61. ymax = 673
  62. xext = Int((xmax - min + 1) * Rnd) + min
  63. xext2 = Int((xmax - min + 1) * Rnd) + min
  64. yext = Int((ymax - min + 1) * Rnd) + min
  65. yext2 = Int((ymax - min + 1) * Rnd) + min
  66. For X = 1 To CInt(Trim(InputBox("Numero di linee da disegnare (da 1 a 32766)", "Disegno random")))
  67. Picture1.Line (xext, yext)-(xext2, yext2)
  68. xext = Int((xmax - min + 1) * Rnd) + min
  69. xext2 = Int((xmax - min + 1) * Rnd) + min
  70. yext = Int((ymax - min + 1) * Rnd) + min
  71. yext2 = Int((ymax - min + 1) * Rnd) + min
  72. Next
  73. raggp = False
  74. End Sub
  75.  
  76. Private Sub mncanc_Click()
  77. Picture1.Picture = LoadPicture("")
  78. End Sub
  79.  
  80. Private Sub mnpulisci_Click()
  81. Picture1.BackColor = Picture1.BackColor
  82. End Sub
  83.  
  84. Private Sub piramide_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  85. Timer2.Enabled = False
  86. rettangolox.Appearance = 0
  87. piramide.Appearance = 1
  88. linea.Appearance = 0
  89. Picture1.DrawWidth = CInt(Text1.Text)
  90. If Picture1.ForeColor = &HFFFFFF Then
  91. If col <> "" Then
  92. Picture1.ForeColor = col
  93. Else
  94. End If
  95. Else
  96.  
  97. End If
  98. Picture1.MouseIcon = LoadPicture("")
  99. Picture1.MousePointer = 2
  100. matita.Appearance = 0
  101. gomma.Appearance = 0
  102. prelev.Appearance = 0
  103. raggp = False
  104. ragg.Appearance = 0
  105. rettangolor.Appearance = 0
  106. rettangolo.Appearance = 0
  107. cerchio.Appearance = 0
  108. puntatore.Appearance = 0
  109. pennello.Appearance = 0
  110. End Sub
  111.  
  112. Private Sub desk_Click()
  113. If MsgBox("Sei sicuro di voler impostare l'immagine come sfondo del desktop?", vbYesNo, "Ruggy Paint 2") Then
  114. SavePicture Picture1.Image, App.Path & "\Desktops\dsk.bmp"
  115. SystemParametersInfo SPI_SETDESKWALLPAPER, 0, App.Path & "\Desktops\dsk.bmp", SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE
  116. Else
  117.  
  118. End If
  119. raggp = False
  120. End Sub
  121. Private Sub Form_Load()
  122. Dim g As Integer
  123. Dim w As Long
  124. If App.PrevInstance = True Then
  125. MsgBox "Errore: il programma è già in esecuzione", vbCritical, "Errore"
  126. End
  127. Else
  128. If Command <> "" Then
  129. Picture1.Picture = LoadPicture(Replace$(Command$(), Chr$(34), ""))
  130. Else
  131.  
  132. End If
  133. Timer2.Enabled = False
  134. raggp = False
  135. pirp = False
  136. matita.Appearance = 1
  137. Form1.Caption = "Ruggy Paint" & " " & App.Major
  138. Form1.AutoRedraw = True
  139.  
  140.  
  141. For g = 0 To 255
  142. Form1.Line (0, w)-(Form1.Width, w + 2), RGB(0, g, g), BF
  143. w = w + 3
  144. Next g
  145. Picture1.Width = 1161
  146. Picture1.Height = 681
  147. End If
  148. End Sub
  149.  
  150. Private Sub gomma_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  151. col = Picture1.ForeColor
  152. Timer2.Enabled = True
  153. matita.Appearance = 0
  154. piramide.Appearance = 0
  155. rettangolox.Appearance = 0
  156. pirp = False
  157. raggp = False
  158. ragg.Appearance = 0
  159. gomma.Appearance = 1
  160. rettangolo.Appearance = 0
  161. prelev.Appearance = 0
  162. rettangolor.Appearance = 0
  163. pennello.Appearance = 0
  164. linea.Appearance = 0
  165. puntatore.Appearance = 0
  166. cerchio.Appearance = 0
  167. Picture1.DrawWidth = CInt(Text1.Text)
  168. Picture1.ForeColor = Picture1.BackColor
  169. Picture1.MouseIcon = LoadPicture("")
  170. Picture1.MousePointer = 2
  171. End Sub
  172.  
  173. Private Sub linea_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  174. linea.Appearance = 1
  175. Picture1.DrawWidth = CInt(Text1.Text)
  176. If Picture1.ForeColor = &HFFFFFF Then
  177. If col <> "" Then
  178. Picture1.ForeColor = col
  179. Else
  180. End If
  181. Else
  182.  
  183. End If
  184. Picture1.MouseIcon = LoadPicture("")
  185. Picture1.MousePointer = 2
  186. matita.Appearance = 0
  187. gomma.Appearance = 0
  188. rettangolox.Appearance = 0
  189. Timer2.Enabled = False
  190. piramide.Appearance = 0
  191. pirp = False
  192. raggp = False
  193. ragg.Appearance = 0
  194. prelev.Appearance = 0
  195. rettangolor.Appearance = 0
  196. rettangolo.Appearance = 0
  197. cerchio.Appearance = 0
  198. puntatore.Appearance = 0
  199. pennello.Appearance = 0
  200. End Sub
  201.  
  202. Private Sub matita_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  203. matita.Appearance = 1
  204. Timer2.Enabled = False
  205. linea.Appearance = 0
  206. raggp = False
  207. ragg.Appearance = 0
  208. gomma.Appearance = 0
  209. cerchio.Appearance = 0
  210. rettangolox.Appearance = 0
  211. rettangolor.Appearance = 0
  212. piramide.Appearance = 0
  213. pirp = False
  214. puntatore.Appearance = 0
  215. rettangolo.Appearance = 0
  216. pennello.Appearance = 0
  217. prelev.Appearance = 0
  218. Picture1.DrawWidth = CInt(Text1.Text)
  219. If Picture1.ForeColor = &HFFFFFF Then
  220. If col <> "" Then
  221. Picture1.ForeColor = col
  222. Else
  223. End If
  224. Else
  225.  
  226. End If
  227. Picture1.MouseIcon = LoadPicture("")
  228. Picture1.MousePointer = 2
  229. End Sub
  230.  
  231. Private Sub mnapri_Click()
  232. If MsgBox("Vuoi salvare il file prima di aprirne un altro?", vbYesNo, "Ruggy Paint" & " " & App.Major) = vbNo Then
  233.  
  234. Else
  235. CommonDialog1.DialogTitle = "Salva"
  236. CommonDialog1.ShowSave
  237. SavePicture Picture1.Image, CommonDialog1.FileName & ".bmp"
  238. End If
  239.  
  240. CommonDialog1.DialogTitle = "Apri"
  241. CommonDialog1.ShowOpen
  242. Picture1.Picture = LoadPicture(CommonDialog1.FileName)
  243. raggp = False
  244. End Sub
  245.  
  246. Private Sub mninfo_Click()
  247. Dim msg
  248. msg = MsgBox("Creato da Ruggy94", vbInformation, "Ruggy Paint" & " " & App.Major)
  249. raggp = False
  250. End Sub
  251.  
  252. Private Sub mnnuovo_Click()
  253. Dim inp
  254. If MsgBox("Vuoi salvare il file prima di creare una nuova immagine?", vbYesNo, "Ruggy Paint" & " " & App.Major) = vbNo Then
  255.  
  256. Else
  257. CommonDialog1.DialogTitle = "Salva"
  258. CommonDialog1.ShowSave
  259. SavePicture Picture1.Image, CommonDialog1.FileName & ".bmp"
  260. End If
  261. Picture1.Height = CInt(Trim(InputBox("Seleziona l'altezza dell'immagine (da 50 a 681)", "Ruggy Paint 2")))
  262. Picture1.Width = CInt(Trim(InputBox("Seleziona la larghezza dell'immagine (da 50 a 1161)", "Ruggy Paint 2")))
  263. Picture1.ScaleWidth = Picture1.Width
  264. Picture1.Picture = LoadPicture("")
  265. Timdimens.Enabled = True
  266. raggp = False
  267. pirp = False
  268. End Sub
  269.  
  270. Private Sub mnsalva_Click()
  271. CommonDialog1.DialogTitle = "Salva"
  272. CommonDialog1.ShowSave
  273. SavePicture Picture1.Image, CommonDialog1.FileName & ".bmp"
  274. raggp = False
  275. End Sub
  276.  
  277. Private Sub ragg_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  278. ragg.Appearance = 1
  279. Timer2.Enabled = False
  280. If Picture1.ForeColor = &HFFFFFF Then
  281. If col <> "" Then
  282. Picture1.ForeColor = col
  283. Else
  284. End If
  285. Else
  286.  
  287. End If
  288. pennello.Appearance = 0
  289. Picture1.DrawWidth = CInt(Text1.Text)
  290. matita.Appearance = 0
  291. linea.Appearance = 0
  292. rettangolox.Appearance = 0
  293. piramide.Appearance = 0
  294. pirp = False
  295. prelev.Appearance = 0
  296. rettangolo.Appearance = 0
  297. rettangolor.Appearance = 0
  298. puntatore.Appearance = 0
  299. gomma.Appearance = 0
  300. cerchio.Appearance = 0
  301. Picture1.MouseIcon = LoadPicture("")
  302. Picture1.MousePointer = 2
  303. End Sub
  304.  
  305. Private Sub pennello_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  306. pennello.Appearance = 1
  307. Timer2.Enabled = False
  308. Picture1.DrawWidth = CInt(Text1.Text)
  309. If Picture1.ForeColor = &HFFFFFF Then
  310. If col <> "" Then
  311. Picture1.ForeColor = col
  312. Else
  313. End If
  314. Else
  315.  
  316. End If
  317. matita.Appearance = 0
  318. piramide.Appearance = 0
  319. pirp = False
  320. raggp = False
  321. ragg.Appearance = 0
  322. rettangolox.Appearance = 0
  323. linea.Appearance = 0
  324. rettangolo.Appearance = 0
  325. prelev.Appearance = 0
  326. rettangolor.Appearance = 0
  327. puntatore.Appearance = 0
  328. gomma.Appearance = 0
  329. cerchio.Appearance = 0
  330. Picture1.MouseIcon = LoadPicture("")
  331. Picture1.MousePointer = 2
  332. End Sub
  333.  
  334. Private Sub Picture1_Mousedown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  335. If cerchio.Appearance = 1 Or linea.Appearance = 1 Or rettangolo.Appearance = 1 Or rettangolor.Appearance = 1 Or piramide.Appearance = 1 Or rettangolox.Appearance = 1 Then
  336. xc = X
  337. yc = Y
  338. End If
  339. End Sub
  340.  
  341. Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  342. Dim Bs As Boolean
  343. If Button Mod 2 = 1 Then Bs = True
  344. If Bs = True Then
  345. If cerchio.Appearance = 0 And puntatore.Appearance = 0 And linea.Appearance = 0 And rettangolo.Appearance = 0 And rettangolor.Appearance = 0 And ragg.Appearance = 0 And piramide.Appearance = 0 And rettangolox.Appearance = 0 And prelev.Appearance = 0 Then
  346. Picture1.Line (mx, my)-(X, Y)
  347. ElseIf ragg.Appearance = 1 Then
  348. If raggp = True Then
  349. Picture1.Line (xragg, yragg)-(X, Y)
  350. Else
  351.  
  352. End If
  353.  
  354. End If
  355. End If
  356. mx = X
  357. my = Y
  358. Label3.Caption = CInt(X) & ";" & CInt(Y)
  359. End Sub
  360.  
  361. Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  362. Dim xi As Single
  363. Dim rgmax As Integer
  364. Dim rgmin As Integer
  365. Dim rgextr As Single
  366. Dim rgextg As Single
  367. Dim rgextb As Single
  368.  
  369. If ragg.Appearance = 1 And raggp = False Then
  370. xragg = X
  371. yragg = Y
  372. raggp = True
  373. ElseIf raggp = True Then
  374. raggp = False
  375. End If
  376. If cerchio.Appearance = 1 Then
  377. Picture1.Circle (xc, yc), Sqr((X - xc) * (X - xc) + (Y - yc) * (Y - yc) / 2)
  378. ElseIf linea.Appearance = 1 Then
  379. Picture1.Line (xc, yc)-(X, Y)
  380. ElseIf rettangolo.Appearance = 1 Then
  381. Picture1.Line (xc, yc)-(X, yc)
  382. Picture1.Line (xc, yc)-(xc, Y)
  383. Picture1.Line (X, yc)-(X, Y)
  384. Picture1.Line (xc, Y)-(X, Y)
  385. End If
  386. If piramide.Appearance = 1 And pirp = False Then
  387. xpir = X
  388. ypir = Y
  389. pirp = True
  390. ElseIf pirp = True Then
  391. Picture1.Line (xc, yc)-(X, yc)
  392. Picture1.Line (xc, yc)-(xc, Y)
  393. Picture1.Line (X, yc)-(X, Y)
  394. Picture1.Line (xc, Y)-(X, Y)
  395.  
  396. Picture1.Line (xpir, ypir)-(xc, yc)
  397. Picture1.Line (xpir, ypir)-(X, Y)
  398. Picture1.Line (xpir, ypir)-(X, yc)
  399. Picture1.Line (xpir, ypir)-(xc, Y)
  400. pirp = False
  401. End If
  402. If rettangolor.Appearance = 1 Then
  403. Picture1.Line (xc, yc)-(X, yc)
  404. Picture1.Line (xc, yc)-(xc, Y)
  405. Picture1.Line (X, yc)-(X, Y)
  406. Picture1.Line (xc, Y)-(X, Y)
  407. If xc < X Then
  408. For xi = xc To X
  409. Picture1.Line (xi, yc)-(xi, Y)
  410. Next
  411. Else
  412. For xi = X To xc
  413. Picture1.Line (xi, Y)-(xi, yc)
  414. Next
  415. End If
  416. End If
  417. If rettangolox.Appearance = 1 Then
  418. Picture1.Line (xc, yc)-(X, yc)
  419. Picture1.Line (xc, yc)-(xc, Y)
  420. Picture1.Line (X, yc)-(X, Y)
  421. Picture1.Line (xc, Y)-(X, Y)
  422. rgmin = 0
  423. rgmax = 255
  424. rgextr = Int((rgmax - rgmin + 1) * Rnd) + rgmin
  425. rgextg = Int((rgmax - rgmin + 1) * Rnd) + rgmin
  426. rgextb = Int((rgmax - rgmin + 1) * Rnd) + rgmin
  427. If xc < X Then
  428. For xi = xc To X
  429. Picture1.Line (xi, yc)-(xi, Y), RGB(rgextr, rgextb, rgextb), BF
  430. rgextr = Int((rgmax - rgmin + 1) * Rnd) + rgmin
  431. rgextg = Int((rgmax - rgmin + 1) * Rnd) + rgmin
  432. rgextb = Int((rgmax - rgmin + 1) * Rnd) + rgmin
  433. Next xi
  434. Else
  435. For xi = X To xc
  436. Picture1.Line (xi, Y)-(xi, yc), RGB(rgextr, rgextg, rgextb), BF
  437. rgextr = Int((rgmax - rgmin + 1) * Rnd) + rgmin
  438. rgextg = Int((rgmax - rgmin + 1) * Rnd) + rgmin
  439. rgextb = Int((rgmax - rgmin + 1) * Rnd) + rgmin
  440. Next
  441. End If
  442. End If
  443. If prelev.Appearance = 1 Then
  444. Picture1.ForeColor = Picture1.Point(X, Y)
  445. Picture3.BackColor = Picture1.Point(X, Y)
  446. End If
  447. End Sub
  448.  
  449. Private Sub Picture2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  450. Picture2.Appearance = 1
  451. End Sub
  452.  
  453. Private Sub Picture2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  454. Picture2.Appearance = 0
  455. CommonDialog1.ShowColor
  456. Picture1.ForeColor = CommonDialog1.Color
  457. raggp = False
  458. End Sub
  459.  
  460. Private Sub cerchio_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  461. cerchio.Appearance = 1
  462. Timer2.Enabled = False
  463. pennello.Appearance = 0
  464. puntatore.Appearance = 0
  465. Picture1.DrawWidth = CInt(Text1.Text)
  466. If Picture1.ForeColor = &HFFFFFF Then
  467. If col <> "" Then
  468. Picture1.ForeColor = col
  469. Else
  470. End If
  471. Else
  472.  
  473. End If
  474. matita.Appearance = 0
  475. raggp = False
  476. ragg.Appearance = 0
  477. rettangolox.Appearance = 0
  478. prelev.Appearance = 0
  479. rettangolo.Appearance = 0
  480. piramide.Appearance = 0
  481. pirp = False
  482. rettangolor.Appearance = 0
  483. linea.Appearance = 0
  484. gomma.Appearance = 0
  485. Picture1.MouseIcon = LoadPicture("")
  486. Picture1.MousePointer = 2
  487. End Sub
  488.  
  489. Private Sub posneg_Click()
  490. Dim imm As Long
  491.  
  492. imm = BitBlt(Picture1.hDC, 0, 0, Picture1.Width, Picture1.ScaleHeight, Picture1.hDC, 0, 0, &H550009)
  493. Picture1.Refresh
  494. raggp = False
  495. End Sub
  496.  
  497. Private Sub puntatore_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  498. puntatore.Appearance = 1
  499. Picture1.MouseIcon = LoadPicture(App.Path & "\" & "3dwarro.cur")
  500. Picture1.MousePointer = 99
  501. gomma.Appearance = 0
  502. raggp = False
  503. ragg.Appearance = 0
  504. linea.Appearance = 0
  505. piramide.Appearance = 0
  506. pirp = False
  507. prelev.Appearance = 0
  508. rettangolox.Appearance = 0
  509. rettangolo.Appearance = 0
  510. rettangolor.Appearance = 0
  511. matita.Appearance = 0
  512. pennello.Appearance = 0
  513. cerchio.Appearance = 0
  514. End Sub
  515.  
  516. Private Sub rettangolo_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  517. rettangolo.Appearance = 1
  518. Timer2.Enabled = False
  519. cerchio.Appearance = 0
  520. pennello.Appearance = 0
  521. puntatore.Appearance = 0
  522. Picture1.DrawWidth = CInt(Text1.Text)
  523. If Picture1.ForeColor = &HFFFFFF Then
  524. If col <> "" Then
  525. Picture1.ForeColor = col
  526. Else
  527. End If
  528. Else
  529.  
  530. End If
  531. matita.Appearance = 0
  532. rettangolor.Appearance = 0
  533. raggp = False
  534. piramide.Appearance = 0
  535. pirp = False
  536. ragg.Appearance = 0
  537. rettangolox.Appearance = 0
  538. prelev.Appearance = 0
  539. linea.Appearance = 0
  540. gomma.Appearance = 0
  541. Picture1.MouseIcon = LoadPicture("")
  542. Picture1.MousePointer = 2
  543. End Sub
  544.  
  545. Private Sub rettangolor_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  546. rettangolor.Appearance = 1
  547. Timer2.Enabled = False
  548. rettangolo.Appearance = 0
  549. raggp = False
  550. ragg.Appearance = 0
  551. cerchio.Appearance = 0
  552. rettangolox.Appearance = 0
  553. pennello.Appearance = 0
  554. puntatore.Appearance = 0
  555. Picture1.DrawWidth = CInt(Text1.Text)
  556. If Picture1.ForeColor = &HFFFFFF Then
  557. If col <> "" Then
  558. Picture1.ForeColor = col
  559. Else
  560. End If
  561. Else
  562.  
  563. End If
  564. matita.Appearance = 0
  565. linea.Appearance = 0
  566. piramide.Appearance = 0
  567. pirp = False
  568. prelev.Appearance = 0
  569. gomma.Appearance = 0
  570. Picture1.MouseIcon = LoadPicture("")
  571. Picture1.MousePointer = 2
  572. End Sub
  573.  
  574. Private Sub rettangolox_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  575. rettangolox.Appearance = 1
  576. Timer2.Enabled = False
  577. rettangolor.Appearance = 0
  578. rettangolo.Appearance = 0
  579. raggp = False
  580. ragg.Appearance = 0
  581. cerchio.Appearance = 0
  582. prelev.Appearance = 0
  583. pennello.Appearance = 0
  584. puntatore.Appearance = 0
  585. Picture1.DrawWidth = CInt(Text1.Text)
  586. If Picture1.ForeColor = &HFFFFFF Then
  587. If col <> "" Then
  588. Picture1.ForeColor = col
  589. Else
  590.  
  591. End If
  592. Else
  593.  
  594. End If
  595. matita.Appearance = 0
  596. linea.Appearance = 0
  597. piramide.Appearance = 0
  598. pirp = False
  599. gomma.Appearance = 0
  600. Picture1.MouseIcon = LoadPicture("")
  601. Picture1.MousePointer = 2
  602. End Sub
  603.  
  604. Private Sub screen_Click()
  605. Dim lar As Long, alt As Long
  606. Clipboard.Clear
  607. Call keybd_event(VK_SNAPSHOT, 0, 0, 0)
  608. DoEvents
  609.  
  610. If Width > Picture1.ScaleWidth Then
  611. lar = Picture1.ScaleWidth
  612. alt = (Picture1.ScaleWidth / Width) * Height
  613. Else
  614. lar = Width
  615. alt = Height
  616. End If
  617.  
  618. Picture1.PaintPicture Clipboard.GetData, 0, 0, lar, alt
  619. raggp = False
  620. End Sub
  621.  
  622. Private Sub squadra_Click()
  623. Dim col
  624. Timer1.Enabled = False
  625. Picture1.DrawWidth = 1
  626. col = Picture1.ForeColor
  627. Picture1.ForeColor = &H0&
  628. Picture1.Line (20, 20)-(Picture1.Width - 20, 20)
  629. Picture1.Line (20, 20)-(20, Picture1.Height - 20)
  630. Picture1.Line (Picture1.Width - 20, 20)-(Picture1.Width - 20, Picture1.Height - 20)
  631. Picture1.Line (20, Picture1.Height - 20)-(Picture1.Width - 20, Picture1.Height - 20)
  632. Picture1.Line ((Picture1.Width - 20) / 2, 20)-((Picture1.Width - 20) / 2, Picture1.Height - 20)
  633. Picture1.Line (20, (Picture1.Height - 20) / 2)-(Picture1.Width - 20, (Picture1.Height - 20) / 2)
  634. Picture1.ForeColor = col
  635. Timer1.Enabled = True
  636. raggp = False
  637. End Sub
  638.  
  639. Private Sub Timdimens_Timer()
  640. If Picture1.Height < 50 Then
  641. Picture1.Height = 50
  642. ElseIf Picture1.Height > 681 Then
  643. Picture1.Height = 681
  644. Else
  645. End If
  646. If Picture1.ScaleHeight < 50 Then
  647. Picture1.ScaleHeight = 50
  648. ElseIf Picture1.ScaleHeight > 681 Then
  649. Picture1.ScaleHeight = 681
  650. Else
  651. End If
  652. If Picture1.Width < 50 Then
  653. Picture1.Width = 50
  654. ElseIf Picture1.Width > 1161 Then
  655. Picture1.Width = 1161
  656. Else
  657. End If
  658. If Picture1.ScaleWidth < 50 Then
  659. Picture1.ScaleWidth = 50
  660. ElseIf Picture1.ScaleWidth > 1161 Then
  661. Picture1.ScaleWidth = 1161
  662. Else
  663. End If
  664. Timdimens.Enabled = False
  665. End Sub
  666.  
  667. Private Sub Timer1_Timer()
  668. Picture3.BackColor = Picture1.ForeColor
  669. If gomma.Appearance = 1 Then
  670. Picture1.ForeColor = Picture1.BackColor
  671. ElseIf matita.Appearance = 1 Then
  672. Picture1.MouseIcon = LoadPicture("")
  673. Picture1.MousePointer = 2
  674. End If
  675. If Text1.Text = "" Then
  676. Text1.Text = "1"
  677. Picture1.DrawWidth = 1
  678. ElseIf CInt(Text1.Text) < 1 Then
  679. Text1.Text = "1"
  680. Picture1.DrawWidth = 1
  681. ElseIf CInt(Text1.Text) > 70 Then
  682. Text1.Text = "70"
  683. Picture1.DrawWidth = 70
  684. End If
  685. Picture1.DrawWidth = CInt(Text1.Text)
  686. If pennello.Appearance = 1 Then
  687. Picture1.DrawWidth = CInt(Text1.Text) + 5
  688. Else
  689. Picture1.DrawWidth = CInt(Text1.Text)
  690. End If
  691.  
  692. If gomma.Appearance = 1 Then
  693. Picture2.Enabled = False
  694. Picture2.Visible = False
  695. Else
  696. Picture2.Enabled = True
  697. Picture2.Visible = True
  698. End If
  699.  
  700. Label1.Caption = Now()
  701. End Sub
  702.  
  703. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  704. If MsgBox("Vuoi salvare il file prima di chiudere il programma?", vbYesNo, "Ruggy Paint" & " " & App.Major) = vbNo Then
  705. End
  706. Else
  707. CommonDialog1.DialogTitle = "Salva"
  708. CommonDialog1.ShowSave
  709. SavePicture Picture1.Image, CommonDialog1.FileName & ".bmp"
  710. End
  711. End If
  712. End Sub
  713.  
  714. Private Sub Timer2_Timer()
  715. If gomma.Appearance = 1 Then
  716. Picture1.ForeColor = Picture1.BackColor
  717. End If
  718. End Sub