• vb.net自定义白板


    请移步:vb.net多功能白板(集成:绘图,编辑,批注,橡皮,图片处理,拍摄,裁剪,旋转等功能_大Mod_abfun的博客-CSDN博客

    希沃白板在学校里基本上是一直使用的,但是在非希沃电脑里面是没有启动白板的

    简答介绍思路和具体的功能

    1、背景颜色和画笔颜色自由切换、画笔粗细1~20可以调节。

    2、画笔样式:虚线、点线、短线

    3、基本图形:矩形,正方形,椭圆,正圆、直线、文字

    4、橡皮、加载、保存功能

    注意点:

    1、主要的画图模块在pic.mousemove事件里,重点

    2、使用        Pic.Invalidate()
                        Pic.Update()

    实现实时更新

    3、drawstring在透明bitmap上绘制文字会有黑边

    源代码公开一下:

    1. Imports System.ComponentModel
    2. Imports System.Drawing.Drawing2D
    3. Public Class Form1
    4. Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    5. SetStyle(ControlStyles.UserPaint, True)
    6. SetStyle(ControlStyles.AllPaintingInWmPaint, True)
    7. SetStyle(ControlStyles.DoubleBuffer, True)
    8. Filled = False
    9. Panel3.Visible = False
    10. Panel1.Visible = False
    11. Pic2.Visible = False
    12. Pic.Location = New Point(-1000, -1000)
    13. Pic.Width = 5000
    14. Pic.Height = 5000
    15. penImg = New Bitmap(Pic.Width, Pic.Height)
    16. g1 = Graphics.FromImage(penImg)
    17. g1.Clear(Color.Transparent)
    18. g1.SmoothingMode = SmoothingMode.HighQuality
    19. ' g1.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit
    20. Pic.Image = penImg
    21. pen.StartCap = LineCap.Round
    22. pen.EndCap = LineCap.Round
    23. If My.Application.CommandLineArgs().Count = 1 Then
    24. penImg = New Bitmap(My.Application.CommandLineArgs(0))
    25. Pic.Width = penImg.Width
    26. Pic.Height = penImg.Height
    27. g1 = Graphics.FromImage(penImg)
    28. 'g1.Clear(Color.Transparent)
    29. g1.SmoothingMode = SmoothingMode.HighQuality
    30. Pic.Image = penImg
    31. pen.StartCap = LineCap.Round
    32. pen.EndCap = LineCap.Round
    33. End If
    34. End Sub
    35. Private Sub Form1_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
    36. ' VW.Stop()
    37. End Sub
    38. Dim MoveDown As Boolean = False
    39. Dim CurrX As Integer
    40. Dim CurrY As Integer
    41. Dim MousX As Integer
    42. Dim MousY As Integer
    43. Dim x1, x2, y1, y2 As Integer
    44. Private Sub Pic_MouseDown(sender As Object, e As MouseEventArgs) Handles Pic.MouseDown
    45. MousX = e.X
    46. MousY = e.Y
    47. MoveDown = True
    48. x1 = e.X
    49. y1 = e.Y
    50. x2 = e.X
    51. y2 = e.Y
    52. End Sub
    53. Dim g1 As Graphics
    54. Public penImg As Bitmap
    55. Dim listPoint As New List(Of Drawing.Point)
    56. Private Sub Pic_MouseMove(sender As Object, e As MouseEventArgs) Handles Pic.MouseMove
    57. If MoveDown = True Then
    58. Pic.Invalidate()
    59. Pic.Update()
    60. If func = 0 Then
    61. CurrX = Pic.Left - MousX + e.X
    62. CurrY = Pic.Top - MousY + e.Y
    63. Pic.Location = New Drawing.Point(CurrX, CurrY)
    64. ElseIf func = 1 Then
    65. listPoint.Add(New Drawing.Point(e.X, e.Y))
    66. If listPoint.Count > 3 Then
    67. g1.DrawCurve(pen, listPoint.ToArray(), 0.1)
    68. End If
    69. 'x1 = e.X
    70. ' y1 = e.Y
    71. ' g1.DrawLine(pen, New Point(x1, y1), New Point(x2, y2))
    72. ' x2 = e.X
    73. ' y2 = e.Y
    74. ElseIf func = 2 Then
    75. Pic2.Visible = True
    76. x1 = e.X
    77. y1 = e.Y
    78. g1.CompositingMode = CompositingMode.SourceCopy
    79. g1.FillRectangle(New SolidBrush(Color.Transparent), New Rectangle(x1 - 25, y1 - 25, 50, 50))
    80. Pic2.Location = New Drawing.Point(x1 + Pic.Location.X - 25, y1 + Pic.Location.Y - 25)
    81. Pic2.Width = 50
    82. Pic2.Height = 50
    83. ElseIf func = 3 Then
    84. If Filled = False Then
    85. Pic.CreateGraphics.DrawEllipse(pen, New Rectangle(x1, y1, e.X - x1, e.Y - y1))
    86. x2 = e.X
    87. y2 = e.Y
    88. Else
    89. Pic.CreateGraphics.FillEllipse(New SolidBrush(pen.Color), New Rectangle(x1, y1, e.X - x1, e.Y - y1))
    90. x2 = e.X
    91. y2 = e.Y
    92. End If
    93. ElseIf func = 4 Then
    94. If Filled = False Then
    95. Pic.CreateGraphics.DrawRectangle(pen, PointList(New Point(x1, y1), New Point(e.X, e.Y)))
    96. x2 = e.X
    97. y2 = e.Y
    98. Else
    99. Pic.CreateGraphics.FillRectangle(New SolidBrush(pen.Color), New Rectangle(x1, y1, e.X - x1, e.Y - y1))
    100. x2 = e.X
    101. y2 = e.Y
    102. End If
    103. ElseIf func = 5 Then
    104. Pic.CreateGraphics.DrawLine(pen, x1, y1, e.X, e.Y)
    105. ElseIf func = 6 Then
    106. If Filled = False Then
    107. Pic.CreateGraphics.DrawRectangle(pen, PointListT(New Point(x1, y1), New Point(e.X, e.Y)))
    108. x2 = e.X
    109. y2 = e.Y
    110. Else
    111. Pic.CreateGraphics.FillRectangle(New SolidBrush(pen.Color), PointListT(New Point(x1, y1), New Point(e.X, e.Y)))
    112. x2 = e.X
    113. y2 = e.Y
    114. End If
    115. ElseIf func = 7 Then
    116. If Filled = False Then
    117. Pic.CreateGraphics.DrawEllipse(pen, PointListT(New Point(x1, y1), New Point(e.X, e.Y)))
    118. x2 = e.X
    119. y2 = e.Y
    120. Else
    121. Pic.CreateGraphics.FillEllipse(New SolidBrush(pen.Color), PointListT(New Point(x1, y1), New Point(e.X, e.Y)))
    122. x2 = e.X
    123. y2 = e.Y
    124. End If
    125. ElseIf func = 8 Then
    126. Pic.CreateGraphics.DrawString(s, TxtFont, New SolidBrush(pen.Color), e.X, e.Y)
    127. End If
    128. 'Pic.Image = penImg
    129. End If
    130. End Sub
    131. Private Sub Pic_MouseUp(sender As Object, e As MouseEventArgs) Handles Pic.MouseUp
    132. MoveDown = False
    133. g1.CompositingMode = CompositingMode.SourceCopy
    134. Pic2.Visible = False
    135. listPoint.Clear()
    136. If func = 3 Then
    137. If Filled = False Then
    138. Pic.Invalidate()
    139. g1.DrawEllipse(pen, New Rectangle(x1, y1, e.X - x1, e.Y - y1))
    140. Else
    141. Pic.Invalidate()
    142. g1.FillEllipse(New SolidBrush(pen.Color), New Rectangle(x1, y1, e.X - x1, e.Y - y1))
    143. End If
    144. End If
    145. If func = 4 Then
    146. If Filled = False Then
    147. Pic.Invalidate()
    148. g1.DrawRectangle(pen, PointList(New Point(x1, y1), New Point(e.X, e.Y)))
    149. Else
    150. Pic.Invalidate()
    151. g1.FillRectangle(New SolidBrush(pen.Color), New Rectangle(x1, y1, e.X - x1, e.Y - y1))
    152. End If
    153. End If
    154. If func = 5 Then
    155. Pic.Invalidate()
    156. g1.DrawLine(pen, x1, y1, e.X, e.Y)
    157. End If
    158. If func = 6 Then
    159. If Filled = False Then
    160. Pic.Invalidate()
    161. g1.DrawRectangle(pen, PointListT(New Point(x1, y1), New Point(e.X, e.Y)))
    162. Else
    163. Pic.Invalidate()
    164. g1.FillRectangle(New SolidBrush(pen.Color), PointListT(New Point(x1, y1), New Point(e.X, e.Y)))
    165. End If
    166. End If
    167. If func = 7 Then
    168. If Filled = False Then
    169. Pic.Invalidate()
    170. g1.DrawEllipse(pen, PointListT(New Point(x1, y1), New Point(e.X, e.Y)))
    171. Else
    172. Pic.Invalidate()
    173. g1.FillEllipse(New SolidBrush(pen.Color), PointListT(New Point(x1, y1), New Point(e.X, e.Y)))
    174. End If
    175. End If
    176. If func = 8 Then
    177. g1 = Graphics.FromImage(penImg)
    178. g1.SmoothingMode = SmoothingMode.HighQuality
    179. g1.TextRenderingHint = 5
    180. Dim stringSize As SizeF = g1.MeasureString(s, TxtFont)
    181. Dim bmp As New Bitmap(CInt(stringSize.Width), CInt(stringSize.Height))
    182. Dim gb As Graphics
    183. gb = Graphics.FromImage(bmp)
    184. If pen.Color <> Color.Black Then
    185. gb.Clear(Color.Black)
    186. gb.TextRenderingHint = 5
    187. gb.DrawString(s, TxtFont, New SolidBrush(pen.Color), 0, 0)
    188. bmp = New Bitmap(ColorReplace(bmp, Color.Black, Color.Transparent))
    189. g1.DrawImage(bmp, New Point(e.X, e.Y))
    190. ElseIf pen.Color = Color.Black Then
    191. gb.Clear(Color.White)
    192. gb.TextRenderingHint = 5
    193. gb.DrawString(s, TxtFont, New SolidBrush(pen.Color), 0, 0)
    194. bmp = New Bitmap(ColorReplace(bmp, Color.White, Color.Transparent))
    195. g1.DrawImage(bmp, New Point(e.X, e.Y))
    196. End If
    197. 'g1.DrawString(s, TxtFont, New SolidBrush(pen.Color), New Point(e.X, e.Y))
    198. End If
    199. Pic.Image = penImg
    200. End Sub
    201. Public Function ColorReplace(bmp As Bitmap, OldColor As Color, NewColor As Color) As Bitmap
    202. Dim destImg As New Bitmap(bmp.Width, bmp.Height)
    203. Dim mycolormap(0) As Imaging.ColorMap
    204. mycolormap(0) = New Imaging.ColorMap()
    205. mycolormap(0).OldColor = OldColor
    206. mycolormap(0).NewColor = NewColor
    207. Dim imageAttributes As New Imaging.ImageAttributes()
    208. imageAttributes.SetRemapTable(mycolormap)
    209. Dim g As Graphics = Graphics.FromImage(destImg)
    210. g.DrawImage(bmp, New Rectangle(0, 0, bmp.Width, bmp.Height), 0, 0, bmp.Width, bmp.Height, GraphicsUnit.Pixel, imageAttributes)
    211. Return destImg
    212. End Function
    213. Dim func As Integer = 0
    214. Dim pen As New Pen(Color.Red, 2)
    215. Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
    216. If func = 0 Then
    217. Dim cdlg As New ColorDialog
    218. If cdlg.ShowDialog() = DialogResult.OK Then
    219. Pic.BackColor = cdlg.Color
    220. End If
    221. End If
    222. func = 0
    223. End Sub
    224. Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
    225. If func = 1 Then
    226. Panel1.Visible = True
    227. Panel1.Location = New Point(Button3.Location.X + Panel2.Location.X, Button3.Location.Y + Panel2.Location.Y - 100)
    228. End If
    229. func = 1
    230. End Sub
    231. Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
    232. func = 2
    233. End Sub
    234. Private Sub Form1_Resize(sender As Object, e As EventArgs) Handles Me.Resize
    235. Panel2.Location = New Point((Width - Panel2.Width) / 2, Height - 100)
    236. l.Location = New Point((Width - l.Width) / 2, (Height - l.Height) / 2)
    237. End Sub
    238. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    239. Panel1.Visible = False
    240. End Sub
    241. Dim s As String
    242. Private Sub Pic_Click(sender As Object, e As EventArgs) Handles Pic.Click
    243. Panel1.Visible = False
    244. End Sub
    245. Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles R1.CheckedChanged
    246. If R1.Checked = True Then
    247. pen.Width = 2
    248. TrB.Value = 2
    249. L1.Text = 2
    250. End If
    251. End Sub
    252. Private Sub R2_CheckedChanged(sender As Object, e As EventArgs) Handles R2.CheckedChanged
    253. If R2.Checked = True Then
    254. pen.Width = 4
    255. TrB.Value = 4
    256. L1.Text = 4
    257. End If
    258. End Sub
    259. Private Sub R3_CheckedChanged(sender As Object, e As EventArgs) Handles R3.CheckedChanged
    260. If R3.Checked = True Then
    261. pen.Width = 8
    262. TrB.Value = 8
    263. L1.Text = 8
    264. End If
    265. End Sub
    266. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    267. Dim save As New SaveFileDialog
    268. save.Filter = "All .net Picture Files|*.jpg;*.png;*.bmp;*.ico;*.jpeg;*.*"
    269. save.InitialDirectory = Application.StartupPath
    270. Dim a = save.ShowDialog
    271. If a = DialogResult.OK Then
    272. penImg.Save(save.FileName)
    273. End If
    274. End Sub
    275. Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
    276. Dim cdlg As New ColorDialog
    277. If cdlg.ShowDialog() = DialogResult.OK Then
    278. pen.Color = cdlg.Color
    279. Button6.BackColor = cdlg.Color
    280. End If
    281. End Sub
    282. Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
    283. pen.Color = Color.Red
    284. Button6.BackColor = Color.Red
    285. End Sub
    286. Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
    287. pen.Color = Color.Black
    288. Button6.BackColor = Color.Black
    289. End Sub
    290. Private Sub PictureBox3_Click(sender As Object, e As EventArgs) Handles PictureBox3.Click
    291. pen.Color = Color.Lime
    292. Button6.BackColor = Color.Lime
    293. End Sub
    294. Private Sub PictureBox4_Click(sender As Object, e As EventArgs) Handles PictureBox4.Click
    295. pen.Color = Color.Cyan
    296. Button6.BackColor = Color.Cyan
    297. End Sub
    298. Private Sub PictureBox5_Click(sender As Object, e As EventArgs) Handles PictureBox5.Click
    299. pen.Color = Color.Blue
    300. Button6.BackColor = Color.Blue
    301. End Sub
    302. Private Sub PictureBox6_Click(sender As Object, e As EventArgs) Handles PictureBox6.Click
    303. pen.Color = Color.Magenta
    304. Button6.BackColor = Color.Magenta
    305. End Sub
    306. Private Sub PictureBox7_Click(sender As Object, e As EventArgs) Handles PictureBox7.Click
    307. pen.Color = Color.Yellow
    308. Button6.BackColor = Color.Yellow
    309. End Sub
    310. Private Sub PictureBox8_Click(sender As Object, e As EventArgs) Handles PictureBox8.Click
    311. pen.Color = Color.Orange
    312. Button6.BackColor = Color.Orange
    313. End Sub
    314. Private Sub TrackBar1_Scroll(sender As Object, e As EventArgs) Handles TrB.Scroll
    315. pen.Width = TrB.Value
    316. L1.Text = TrB.Value
    317. End Sub
    318. Private Sub PictureBox9_Click(sender As Object, e As EventArgs) Handles PictureBox9.Click
    319. pen.Color = Color.White
    320. Button6.BackColor = Color.White
    321. End Sub
    322. Private Sub bg1_CheckedChanged(sender As Object, e As EventArgs) Handles bg1.CheckedChanged
    323. If bg1.Checked = True Then
    324. Filled = False
    325. End If
    326. End Sub
    327. Private Sub bg2_CheckedChanged(sender As Object, e As EventArgs) Handles bg2.CheckedChanged
    328. If bg2.Checked = True Then
    329. Filled = True
    330. End If
    331. End Sub
    332. Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
    333. If MsgBox("确认清屏!", vbInformation + vbYesNo, "自定义白板") = MsgBoxResult.Yes Then
    334. g1.Clear(Color.Transparent)
    335. Pic.Image = penImg
    336. End If
    337. End Sub
    338. Private Sub RadioButton1_CheckedChanged_1(sender As Object, e As EventArgs) Handles ls0.CheckedChanged
    339. If ls0.Checked = True Then
    340. pen.DashStyle = DashStyle.Solid
    341. End If
    342. End Sub
    343. Private Sub sc0_CheckedChanged(sender As Object, e As EventArgs) Handles sc0.CheckedChanged
    344. If sc0.Checked = True Then
    345. pen.StartCap = LineCap.Flat
    346. End If
    347. End Sub
    348. Private Sub sc1_CheckedChanged(sender As Object, e As EventArgs) Handles sc1.CheckedChanged
    349. If sc1.Checked = True Then
    350. pen.StartCap = LineCap.ArrowAnchor
    351. End If
    352. End Sub
    353. Private Sub sc2_CheckedChanged(sender As Object, e As EventArgs) Handles sc2.CheckedChanged
    354. If sc2.Checked = True Then
    355. pen.StartCap = LineCap.Round
    356. End If
    357. End Sub
    358. Private Sub ec0_CheckedChanged(sender As Object, e As EventArgs) Handles ec0.CheckedChanged
    359. If ec0.Checked = True Then
    360. pen.EndCap = LineCap.Flat
    361. End If
    362. End Sub
    363. Private Sub ec1_CheckedChanged(sender As Object, e As EventArgs) Handles ec1.CheckedChanged
    364. If ec1.Checked = True Then
    365. pen.EndCap = LineCap.ArrowAnchor
    366. End If
    367. End Sub
    368. Private Sub ec2_CheckedChanged(sender As Object, e As EventArgs) Handles ec2.CheckedChanged
    369. If ec2.Checked = True Then
    370. pen.EndCap = LineCap.Round
    371. End If
    372. End Sub
    373. Private Sub ls1_CheckedChanged(sender As Object, e As EventArgs) Handles ls1.CheckedChanged
    374. If ls1.Checked = True Then
    375. pen.DashStyle = DashStyle.Dot
    376. End If
    377. End Sub
    378. Private Sub ls2_CheckedChanged(sender As Object, e As EventArgs) Handles ls2.CheckedChanged
    379. If ls2.Checked = True Then
    380. pen.DashStyle = DashStyle.DashDot
    381. End If
    382. End Sub
    383. Private Sub ls3_CheckedChanged(sender As Object, e As EventArgs) Handles ls3.CheckedChanged
    384. If ls3.Checked = True Then
    385. pen.DashStyle = DashStyle.Dash
    386. End If
    387. End Sub
    388. Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
    389. func = 3
    390. End Sub
    391. Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
    392. func = 4
    393. End Sub
    394. Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
    395. func = 5
    396. End Sub
    397. Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click
    398. func = 6
    399. End Sub
    400. Private Sub Button13_Click(sender As Object, e As EventArgs) Handles Button13.Click
    401. func = 7
    402. End Sub
    403. Private Sub Button14_Click(sender As Object, e As EventArgs) Handles Button14.Click
    404. func = 8
    405. s = InputBox("输入文字", "自定义白板")
    406. End Sub
    407. Private Sub Button5_MouseDown(sender As Object, e As MouseEventArgs) Handles Button5.MouseDown
    408. If e.Button = MouseButtons.Right Then
    409. If MsgBox("确认清屏!", vbInformation + vbYesNo, "自定义白板") = MsgBoxResult.Yes Then
    410. g1.Clear(Color.Transparent)
    411. Pic.Image = penImg
    412. End If
    413. End If
    414. End Sub
    415. Public Function PointList(p1 As Point, p2 As Point) As Rectangle
    416. Dim p3 As Point
    417. Dim p4 As Point
    418. Dim width As Integer
    419. Dim height As Integer
    420. Dim LeftTop As Point
    421. If p1.X < p2.X AndAlso p1.Y < p2.Y Then
    422. p3 = New Point(p2.X, p1.X)
    423. p4 = New Point(p1.X, p2.Y)
    424. width = p3.X - p1.X
    425. height = p4.Y - p1.Y
    426. LeftTop = p1
    427. ElseIf p1.X > p2.X AndAlso p1.Y < p2.Y Then
    428. p3 = New Point(p1.X, p2.Y)
    429. p4 = New Point(p2.X, p1.Y)
    430. width = p1.X - p4.X
    431. height = p2.Y - p4.Y
    432. LeftTop = p4
    433. ElseIf p1.X > p2.X AndAlso p1.Y > p2.Y Then
    434. p3 = New Point(p1.X, p2.X)
    435. p4 = New Point(p2.X, p1.Y)
    436. width = p3.X - p2.X
    437. height = p4.Y - p2.Y
    438. LeftTop = p2
    439. ElseIf p1.X < p2.X AndAlso p1.Y > p2.Y Then
    440. p3 = New Point(p2.X, p1.Y)
    441. p4 = New Point(p1.X, p2.Y)
    442. width = p2.X - p4.X
    443. height = p1.Y - p4.Y
    444. LeftTop = p4
    445. End If
    446. Return New Rectangle(LeftTop, New Size(width, height))
    447. End Function
    448. Dim TxtFont As New Font("微软雅黑", 30, FontStyle.Regular)
    449. Private Sub Button15_Click(sender As Object, e As EventArgs) Handles Button15.Click
    450. Dim fdlg As New FontDialog
    451. If fdlg.ShowDialog() = DialogResult.OK Then
    452. TxtFont = fdlg.Font
    453. End If
    454. End Sub
    455. Private Sub Button16_Click(sender As Object, e As EventArgs) Handles Button16.Click
    456. Panel3.Visible = False
    457. End Sub
    458. Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
    459. Panel3.Visible = True
    460. Panel3.Location = New Point(Button8.Location.X + Panel2.Location.X, Button8.Location.Y + Panel2.Location.Y - 250)
    461. End Sub
    462. Private Sub Button17_Click(sender As Object, e As EventArgs) Handles Button17.Click
    463. Button6.PerformClick()
    464. End Sub
    465. Public Function PointListT(p1 As Point, p2 As Point) As Rectangle
    466. Dim p3 As Point
    467. Dim p4 As Point
    468. Dim width As Integer
    469. Dim height As Integer
    470. Dim LeftTop As Point
    471. If p1.X < p2.X AndAlso p1.Y < p2.Y Then
    472. p3 = New Point(p2.X, p1.X)
    473. p4 = New Point(p1.X, p2.Y)
    474. width = p3.X - p1.X
    475. height = width
    476. LeftTop = p1
    477. ElseIf p1.X > p2.X AndAlso p1.Y < p2.Y Then
    478. p3 = New Point(p1.X, p2.Y)
    479. p4 = New Point(p2.X, p1.Y)
    480. width = p1.X - p4.X
    481. height = width
    482. LeftTop = p4
    483. ElseIf p1.X > p2.X AndAlso p1.Y > p2.Y Then
    484. p3 = New Point(p1.X, p2.X)
    485. p4 = New Point(p2.X, p1.Y)
    486. width = p3.X - p2.X
    487. height = width
    488. LeftTop = New Point(p1.X - width, p1.Y - width)
    489. ElseIf p1.X < p2.X AndAlso p1.Y > p2.Y Then
    490. p3 = New Point(p2.X, p1.Y)
    491. p4 = New Point(p1.X, p2.Y)
    492. width = p2.X - p4.X
    493. height = width
    494. LeftTop = New Point(p1.X, p1.Y - width)
    495. End If
    496. Return New Rectangle(LeftTop, New Size(width, height))
    497. End Function
    498. Private Sub Form1_DoubleClick(sender As Object, e As EventArgs) Handles Me.DoubleClick
    499. Pic.Location = New Point(0, 0)
    500. End Sub
    501. Dim Filled As Boolean
    502. Dim LineStyle As Integer = 0
    503. End Class

    源代码文件在这:camera类其实没有用,你们自己使用可以删掉它

    链接:https://pan.baidu.com/s/1Q_TAzBGJ5FtjE3UHJuvYqw?pwd=1234 
    提取码:1234

  • 相关阅读:
    vue使用tinymce(新增字数限制)
    药品研发--检验记录与检验报告书的书写细则
    【云原生】第十篇--Docker主机集群化方案 Docker Swarm
    【Unity】Resources.Load
    项目添加以vue为后缀名的vue文件,怎么解析打包
    容器运行elasticsearch安装ik分词非root权限安装报错问题
    二叉搜索树
    Letter shell移植到AT32WB415
    深度学习之CNN宫颈癌预测
    k8s二进制安装与部署
  • 原文地址:https://blog.csdn.net/weixin_56050945/article/details/127824620