[android-beginners] Re: Adding Undo feature in FingerPaint app bundled with APIdemos.

2009-10-09 Thread Monu Tripathi

:)

Thanks James for your reply.

I was skeptical about the said approach because it will consume some
memory and we all know how precious that is on the device. I was
checking to make sure that I am not missing anything available in the
framework, here.

If the framework could let us have hooks for establishing savepoints
and then reverting back to them, I'd rather used that approach.


On Oct 9, 12:15 am, James Yum j...@google.com wrote:
 Hi Samuh,

 I think you're on the right path.
 Cheers,
 James



 On Wed, Oct 7, 2009 at 11:42 PM, Samuh Varta samuh.va...@gmail.com wrote:

  @Romain: thanks for your reply...I'd *like* to believe that you wrote
  FingerPaint and would help me here :)

  Most of the applications in the Android Market(PicSay et al.) that
  provide a similar feature(drawing strokes on canvas) provide Undo
  functionality. I was trying to imitate the same in the original
  FingerPaint app.

  My approach to implementing this feature,as already mentioned in the
  earlier post, would be to:
  1. memorize all the paths,
  2. reset the canvas and
  3. redraw all the paths again expect the last one.

  I was wondering if there was any alternative to this? Is there any
  class in the framework that can help me here?

  Please help.

  Thanks again!

  On Oct 7, 9:34 pm, Romain Guy romain...@google.com wrote:
   save() and restore() are just used to save the state of the Canvas
   (translate, scale, etc.) It won't help you for what you want.

   On Wed, Oct 7, 2009 at 12:26 AM, Samuh Varta samuh.va...@gmail.com
  wrote:
I am playing with the FingerPaint application that comes bundled with
  the
API demos package. I was wondering if I could add an Undo feature to
  it,
which would allow the user to remove/undo his latest stroke drawing
  from the
canvas. I am not sure of how to achieve this though.

I was looking at the android.graphics.Canvas class and therein I found
  a few
methods that caught my interest.
canvas.restore() and canvas.save(). But I couldn't get them to work per
  my
requirement.

One of the approach could be memorizing all the Path(representing
  strokes
drawn) and then resetting the canvas and reapinting all the stroked one
  by
one except the latest. I somehow dont like this approach.
How do I undo my drawings on canvas?
Please help.

Thanks.

   --
   Romain Guy
   Android framework engineer
   romain...@android.com

   Note: please don't send private questions to me, as I don't have time
   to provide private support.  All such questions should be posted on
   public forums, where I and others can see and answer them- Hide quoted
  text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Beginners group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Adding Undo feature in FingerPaint app bundled with APIdemos.

2009-10-08 Thread Samuh Varta

@Romain: thanks for your reply...I'd *like* to believe that you wrote
FingerPaint and would help me here :)

Most of the applications in the Android Market(PicSay et al.) that
provide a similar feature(drawing strokes on canvas) provide Undo
functionality. I was trying to imitate the same in the original
FingerPaint app.

My approach to implementing this feature,as already mentioned in the
earlier post, would be to:
1. memorize all the paths,
2. reset the canvas and
3. redraw all the paths again expect the last one.

I was wondering if there was any alternative to this? Is there any
class in the framework that can help me here?

Please help.

Thanks again!


On Oct 7, 9:34 pm, Romain Guy romain...@google.com wrote:
 save() and restore() are just used to save the state of the Canvas
 (translate, scale, etc.) It won't help you for what you want.





 On Wed, Oct 7, 2009 at 12:26 AM, Samuh Varta samuh.va...@gmail.com wrote:
  I am playing with the FingerPaint application that comes bundled with the
  API demos package. I was wondering if I could add an Undo feature to it,
  which would allow the user to remove/undo his latest stroke drawing from the
  canvas. I am not sure of how to achieve this though.

  I was looking at the android.graphics.Canvas class and therein I found a few
  methods that caught my interest.
  canvas.restore() and canvas.save(). But I couldn't get them to work per my
  requirement.

  One of the approach could be memorizing all the Path(representing strokes
  drawn) and then resetting the canvas and reapinting all the stroked one by
  one except the latest. I somehow dont like this approach.
  How do I undo my drawings on canvas?
  Please help.

  Thanks.

 --
 Romain Guy
 Android framework engineer
 romain...@android.com

 Note: please don't send private questions to me, as I don't have time
 to provide private support.  All such questions should be posted on
 public forums, where I and others can see and answer them- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Beginners group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Adding Undo feature in FingerPaint app bundled with APIdemos.

2009-10-08 Thread James Yum
Hi Samuh,

I think you're on the right path.
Cheers,
James

On Wed, Oct 7, 2009 at 11:42 PM, Samuh Varta samuh.va...@gmail.com wrote:


 @Romain: thanks for your reply...I'd *like* to believe that you wrote
 FingerPaint and would help me here :)

 Most of the applications in the Android Market(PicSay et al.) that
 provide a similar feature(drawing strokes on canvas) provide Undo
 functionality. I was trying to imitate the same in the original
 FingerPaint app.

 My approach to implementing this feature,as already mentioned in the
 earlier post, would be to:
 1. memorize all the paths,
 2. reset the canvas and
 3. redraw all the paths again expect the last one.

 I was wondering if there was any alternative to this? Is there any
 class in the framework that can help me here?

 Please help.

 Thanks again!


 On Oct 7, 9:34 pm, Romain Guy romain...@google.com wrote:
  save() and restore() are just used to save the state of the Canvas
  (translate, scale, etc.) It won't help you for what you want.
 
 
 
 
 
  On Wed, Oct 7, 2009 at 12:26 AM, Samuh Varta samuh.va...@gmail.com
 wrote:
   I am playing with the FingerPaint application that comes bundled with
 the
   API demos package. I was wondering if I could add an Undo feature to
 it,
   which would allow the user to remove/undo his latest stroke drawing
 from the
   canvas. I am not sure of how to achieve this though.
 
   I was looking at the android.graphics.Canvas class and therein I found
 a few
   methods that caught my interest.
   canvas.restore() and canvas.save(). But I couldn't get them to work per
 my
   requirement.
 
   One of the approach could be memorizing all the Path(representing
 strokes
   drawn) and then resetting the canvas and reapinting all the stroked one
 by
   one except the latest. I somehow dont like this approach.
   How do I undo my drawings on canvas?
   Please help.
 
   Thanks.
 
  --
  Romain Guy
  Android framework engineer
  romain...@android.com
 
  Note: please don't send private questions to me, as I don't have time
  to provide private support.  All such questions should be posted on
  public forums, where I and others can see and answer them- Hide quoted
 text -
 
  - Show quoted text -
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Beginners group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Adding Undo feature in FingerPaint app bundled with APIdemos.

2009-10-07 Thread Romain Guy

save() and restore() are just used to save the state of the Canvas
(translate, scale, etc.) It won't help you for what you want.

On Wed, Oct 7, 2009 at 12:26 AM, Samuh Varta samuh.va...@gmail.com wrote:
 I am playing with the FingerPaint application that comes bundled with the
 API demos package. I was wondering if I could add an Undo feature to it,
 which would allow the user to remove/undo his latest stroke drawing from the
 canvas. I am not sure of how to achieve this though.

 I was looking at the android.graphics.Canvas class and therein I found a few
 methods that caught my interest.
 canvas.restore() and canvas.save(). But I couldn't get them to work per my
 requirement.

 One of the approach could be memorizing all the Path(representing strokes
 drawn) and then resetting the canvas and reapinting all the stroked one by
 one except the latest. I somehow dont like this approach.
 How do I undo my drawings on canvas?
 Please help.

 Thanks.
 




-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Beginners group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---