Link to home
Start Free TrialLog in
Avatar of running32
running32

asked on

Use a pencil to add color to an image

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.
ASKER CERTIFIED SOLUTION
Avatar of VoteyDisciple
VoteyDisciple

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of running32
running32

ASKER

I will take a look, Thank you
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
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?
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.

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.
Thank you for your help