Groups | Blog | Home
all groups > visual studio .net general > april 2004 >

visual studio .net general : Image Editor tool bar


Alex Bombino
4/13/2004 8:19:31 PM
Hi guys,

I am new in VB.net and I like so far. This is an easy
question but I just don't know how to draw a simple line
in a form. In a design mode I made the image editor tool
bar to display but all the icons are disable. How can I
make the icons in the image editor enable so I can use the
line button to draw the line in a form ?

Alex Bombino
4/14/2004 7:26:40 AM
Thanks Carlos for your response. The code provided works=20
well. However; Do you know how to change the width on the=20
line.

[quoted text, click to view]
Carlos J. Quintero [MVP]
4/14/2004 3:25:29 PM
The image editor is intended to draw on bitmap or icon resources, not in
forms. In your case, you can override the OnPaint procedure and make your
drawings there. For example (VB.NET):

Protected Overrides Sub OnPaint(ByVal e As
System.Windows.Forms.PaintEventArgs)
e.Graphics.DrawLine(System.Drawing.Pens.Blue, 0, 0, 100, 100)
End Sub

--

Carlos J. Quintero (Visual Developer - .NET MVP)

FAQs, Knowledge Base, Files, Docs, Articles, Utilities, etc. for .NET
addins:
http://groups.yahoo.com/group/vsnetaddin/ (free join)



"Alex Bombino" <anonymous@discussions.microsoft.com> escribió en el mensaje
news:1c35401c421cf$4d559de0$a301280a@phx.gbl...
[quoted text, click to view]

Carlos J. Quintero [MVP]
4/15/2004 10:59:32 AM
You need to buy a thicker pen ;-)

This one has 4 pixels of width:

Protected Overrides Sub OnPaint(ByVal e As
System.Windows.Forms.PaintEventArgs)

Dim objPen As New System.Drawing.Pen(System.Drawing.Color.Blue, 4)
e.Graphics.DrawLine(objPen, 0, 0, 100, 100)
objPen.Dispose()

End Sub

--

Carlos J. Quintero (Visual Developer - .NET MVP)

FAQs, Knowledge Base, Files, Docs, Articles, Utilities, etc. for .NET
addins:
http://groups.yahoo.com/group/vsnetaddin/ (free join)




"Alex Bombino" <anonymous@discussions.microsoft.com> escribió en el mensaje
news:199fb01c4222c$8071bee0$a601280a@phx.gbl...
Thanks Carlos for your response. The code provided works
well. However; Do you know how to change the width on the
line.

[quoted text, click to view]

AddThis Social Bookmark Button