?
Solved

Use a pencil to add color to an image

Posted on 2006-11-30
7
Medium Priority
?
269 Views
Last Modified: 2010-04-23
Is there a way in vb.net for a user to select a pencil and add some color to an image and that color change be saved?
I am trying to write a program where I work for low income kids to mark where they have cavities on an image.

I realize this is not easy but I would be greatful if someone could point me in the correct direction.

Thank you.
0
Comment
Question by:running32
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 19

Accepted Solution

by:
VoteyDisciple earned 2000 total points
ID: 18046404
Drawing like that in .NET is surprisingly easy.  Even saving the image is fairly simple.  

Take a look at: http://www.codeproject.com/vb/net/Freehand_Drawing.asp

0
 

Author Comment

by:running32
ID: 18046439
I will take a look, Thank you
0
 

Author Comment

by:running32
ID: 18053578
That works great but how can I save the markings for this person.  I know I can made a table and store the corodinates but I am not sure how to save or retrieve.

Thank you
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 18054149
Ah, I thought you were just interested in saving the image as an image.  If it's the actual points you need to store that'd take a little more work.  Is the aim to have a file stored on disk that lists the coordinates where the kid painted so you can reconstruct the image later?
0
 

Author Comment

by:running32
ID: 18054322
Yes that is exactly what I need to do.  The drawing part works great btw.  The image in the box is a diagram of childrens teeth.  We need to mark where they have a cavities  :-(  then be able to pull up their records next time we see them.   Because of the demographics it in not unusally for them to have many areas shaded.  Thank you.

0
 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 18054567
Yeah, I just figured you'd be saving the image directly so you could just display it again.

Here's what I'd suggest to save the coordinates
1.  Declare:
Private _coordinates As New StringBuilder

2.  Each time you paint a point on the screen, add as a string
_coordinates.Append(x & "," & y & ControlChars.NewLine)

(where x and y are whatever variables you're using for the coordinates in the painting part)

3.  To save, write that out to disk.  See http://www.freevbcode.com/ShowCode.Asp?ID=4492 for examples of file I/O


To read, you'd have a trickier problem.  Upon reading each line you'd have to do something like:
Dim pieces As String() = line.Split(",") ' Assuming 'line' is the line just read from the file.

Now paint a new point using pieces(0) as the X coordinate and pieces(1) as the Y coordinate.
0
 

Author Comment

by:running32
ID: 18054774
Thank you for your help
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month13 days, 2 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question