5,443,978 members and growing! (21,748 online)
Email Password   helpLost your password?
Multimedia » GDI+ » General     Intermediate

A Simple VB.NET Freehand Drawing method

By John Buettner

The code uses a System.Drawing.Drawing2D.GraphicsPath method to follow the users mouse movements. The path is then painted in the control.
VBWindows, .NET, .NET 1.0, Win2K, WinXP, Win2003VS.NET2002, Visual Studio, Dev

Posted: 26 Jul 2003
Updated: 26 Jul 2003
Views: 68,466
Bookmarked: 13 times
Announcements
Want a new Job?



Search    
Advanced Search
Sitemap
18 votes for this Article.
Popularity: 4.31 Rating: 3.43 out of 5
3 votes, 16.7%
1
0 votes, 0.0%
2
3 votes, 16.7%
3
4 votes, 22.2%
4
8 votes, 44.4%
5

Sample Image - Freehand_Drawing.jpg

Introduction

This is a simple freehand drawing example for VB.NET. I was frustrated at not finding a simple way to draw on a control or a picture in VB.NET. What was a simple task in VB6, seemed to take hundreds of lines of code in .NET sample code. Hopefully this will give other VB.NET programmers ideas on a simple implementation of this type of code.

The code uses a System.Drawing.Drawing2D.GraphicsPath method to follow the users mouse movements. The path is then painted in the control.

Background

Ideas for this code came from the Microsoft "Scribble" sample code, Christian Graus's excellent article on a C++ code called "Doodle" and the Microsoft website.

Note that this is a VERY pedantic freehand drawing code, so be kind in you comments. :)

History

  • Written July, 2003

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

John Buettner



Location: United States United States

Other popular GDI+ articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 11 of 11 (Total in Forum: 11) (Refresh)FirstPrevNext
Subject  Author Date 
GeneralSystem.OutOfMemoryException occurred in System.Drawing.dll (converted 2005)memberyalenap13:23 1 Apr '08  
GeneralHow I erase ?memberdemon.kiler11:44 7 Jun '07  
GeneralRe: How I erase ?memberamit122719:39 21 Jun '07  
GeneralRe: How I erase ?memberRichard_Faulkner13:54 21 Aug '07  
GeneralPaint above /on activexcontrol? [modified]memberturbovulc5:03 31 Jul '06  
GeneralHow can I save content of PictureBoxmemberdragondrache5:55 19 Oct '04  
GeneralRe: How can I save content of PictureBoxmemberNatBest18:53 23 Mar '06  
GeneralClear PictureBox1memberdragondrache7:50 18 Oct '04  
GeneralRe: Clear PictureBox1memberloay454518:32 28 Apr '06  
Generaldrawing colormemberPythorian10:51 5 Nov '03  
GeneralInk ObjectmemberNick Seng17:03 27 Jul '03  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 26 Jul 2003
Editor: Nishant Sivakumar
Copyright 2003 by John Buettner
Everything else Copyright © CodeProject, 1999-2008
Web15 | Advertise on the Code Project