Flow selection box for implementing PhotoShop using VB. NET

Source: Internet
Author: User

Flow selection box for implementing PhotoShop using VB. NETHello everyone, I wrote an article for the first time (EXCITED). I read several articles from the development experts that talked about the flow selection box in Photoshop. In fact, the implementation is not difficult. Here I will use VB. net implementation, in. NET provides a very powerful function of GDI +. The previous article C # uses GDI +, and I will also use it here! Actually, there is no difference! Hope to learn VB. net is helpful, the following is the source code: Create a New VB Application, add a time (timer) component in a window, interval is set to 50 subtle, imports system. drawing. drawing2d
Imports system. Drawing. Graphics
Public class form1
Inherits system. Windows. Forms. Form
Private pen as pen creates a paint brush object
Private gpath as new graphicspath 'instantiate path object
Private dpattern () as single = {5.0, 7.0} 'solid line length and dotted line length
Private offset As Single = 0.0 'offset value # Region "code generated by Windows Form Designer" Public Sub New ()
MyBase. New () 'is required by the Windows Form Designer.
InitializeComponent () 'After InitializeComponent () is called, add any initialized End Sub' form to override dispose to clear the component list.
Protected Overloads Overrides Sub Dispose (ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
Components. Dispose ()
End If
GPath. Dispose ()
Pen. Dispose ()
End If
MyBase. Dispose (disposing)
End Sub required by the Windows Form Designer
Private components As System. ComponentModel. IContainer Note: The following process is required by the Windows Forms designer
'You can use the Windows Form Designer to modify this process.
'Do not use the code editor to modify it.
Friend WithEvents Timer1 As System. Windows. Forms. Timer
<System. Diagnostics. debuggerstepthrough ()> private sub initializecomponent ()
Me. components = new system. componentmodel. Container
Me. timer1 = new system. Windows. Forms. Timer (Me. components)
'
'Timer1
'
Me. timer1.enabled = true
Me. timer1.interval = 50
'
'Form1
'
Me. autoscalebasesize = new system. Drawing. Size (6, 14)
Me. ClientSize = New System. Drawing. Size (416,166)
Me. FormBorderStyle = System. Windows. Forms. FormBorderStyle. FixedSingle
Me. MaximizeBox = False
Me. MinimizeBox = False
Me. Name = "Form1"
Me. StartPosition = System. Windows. Forms. FormStartPosition. CenterScreen
Me. Text = "Photo For VB. NET" End Sub # End Region Private Sub timerspontick (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles Timer1.Tick
Me. Refresh () 'Refresh the window
End sub private sub form=paint (byval sender as object, byval e as system. Windows. Forms. painteventargs) handles mybase. Paint
Pen. dashoffset = offset 'sets the offset value.
E. Graphics. drawpath (pen, gpath) 'draw path' to change the Offset Value
Offset ++ = 1.0
If offset/100 = 1 then
Offset = 0.0
End if end sub
Private Sub Form1_Load (ByVal sender As Object, ByVal e As System. EventArgs) Handles MyBase. Load
GPath. AddString ("computer ",_
New FontFamily (" "),_
FontStyle. Bold + FontStyle. Italic ,_
1200000f ,_
New PointF (30366f, 20366f ),_
New StringFormat) 'Add a character path
Pen = New Pen (Color. Black) 'build a paint brush
Pen. DashPattern = Dpattern 'custom dashes and blank areas
Pen. DashStyle = DashStyle. m 'specify the value of DashStyle. Custom for this attribute: DashPattern defined by the DashPattern attribute and Custom pattern of the blank area.
End Sub
End Class
Compiled in WINXP + SP1 + VS. NET2003

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.