Solved

Use a pencil to add color to an image

Posted on 2006-11-30
7
262 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
  • 4
  • 3
7 Comments
 
LVL 19

Accepted Solution

by:
VoteyDisciple earned 500 total points
Comment Utility
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
Comment Utility
I will take a look, Thank you
0
 

Author Comment

by:running32
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 19

Expert Comment

by:VoteyDisciple
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you for your help
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now