Solved

Use a pencil to add color to an image

Posted on 2006-11-30
7
266 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 500 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
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!

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
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…

726 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