Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi, I am developing a paint like application in metro style. I want to apply a eraser functionality. So how can I make such a tool for erasing the content from canvas like we do in MS paint ?
 
I don't want to clear whole canvas, wherever I click or drag the pointer, the path traveled by the pointer should be erased.
Posted 27-Jun-12 2:58am
Edited 27-Jun-12 4:09am
v3
Comments
Sergey Alexandrovich Kryukov at 27-Jun-12 12:49pm
   
What, is your MSDN broken?
--SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I have no experience in metro, but erasing in a raster environment is nothing more than painting with background color.
  Permalink  
Comments
Sergey Alexandrovich Kryukov at 27-Jun-12 12:48pm
   
Sorry, Zoltán; I had to vote 1. Why would you answer about something you have no idea about?
This is not always true even for raster graphics; for example, erasing could be setting zeros in alpha channel.
As to Metro application, most typical graphics is putting shapes in some container like Panel. So erasing would be removing objects from their container.
--SA
Zoltán Zörgő at 27-Jun-12 14:38pm
   
Feel free to give point as you like. You might have right, but I also might have right. I never said this are not options. You know Occam's razor? Taking in consideration statement like "MS paint", "path should be erased".. and so on, will never conclude to removing objects from their container - only if you consider canvas as a container of it's pixels. Yes, you can do fancy things... but not always the most complex one is the answer. Using these starting information, I still believe, that changing a pixel color to background is the most possible solution. Oh and I never said, that the background cannot be transparent, or translucent, or whatever... And by the way, since a you can make metro style app in html5, the canvas concept in metro should be really close to html5 canvas element. Never mind... I have no idea about... sorry...
Sergey Alexandrovich Kryukov at 29-Jun-12 18:43pm
   
Vector graphics is conceptually different. Still there are pixels (usually), but they are abstracted out. Of course I'm familiar with Occam's razor, but I'm not trying to break this principle here.
Thank you for understanding.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 27 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100