tags:

views:

26

answers:

1

On one of the applications that I am writing, I was asked to provide the feature for "pencil and eraser" to allow the user to doodle randomly on a document (for proofreading, note-taking, etc.)

What would be the best way to store such data?

I was thinking of using an image with transparency for each doodle (so that I can also support multiple colors of "doodles") but it seems like it will very quickly make any saved project with doodles grow large in file size.

I am looking if there is a better (existing) alternative (e.g. is there a DoodleXML spec out there?) or just any suggestions.

Thanks.

A: 

I think the "DoodleXML" spec you're looking for might just be SVG. Simply save the doodles as a series of lines. You don't need a full SVG engine as long as you're only supporting the subset that you generate in the first place.

Gabe
Hmm.. the same goes for erasures? Erasure strokes will be stored as series of lines? And then strokes and erasures will be rendered in the order they were drawn? Would that be okay, rendering-performance-wise?
bundat
I would represent the erasures as either clipping paths or masks depending on how you want to implement it.
Gabe