Solved

Use a pencil to add color to an image

Posted on 2006-11-30
7
265 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
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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

791 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