[android-developers] Re: Drawing complex shapes with hollow parts

2012-11-23 Thread Simon Giddings
In fact, after doing some further work on this, this is what I have found :

The simplest way of achieving this is to 

   1. Create the path object
   2. Set the fill type to  Path.FillType.WINDING .
   3. draw the outline segments using lineTo, cubicTo, etc, ensuring that 
   the outline closes itself.
   4. draw the inner holes, each one using a different direction. ie: if 
   the outline was drawn clockwise, then the first hole must be 
   anti-clockwise, the second clockwise, etc...
   5. Draw the path on the canvas with  Canvas.drawPath(...) .
   

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

[android-developers] Re: Drawing complex shapes with hollow parts

2012-11-12 Thread Piren
http://stackoverflow.com/questions/11337679/porterduffxfermode-clear-a-section-of-a-bitmap

On Monday, November 12, 2012 12:16:17 PM UTC+2, Simon Giddings wrote:

 I am needing to draw shapes which will have hollow regions.
 To simplify the idea, take an ampersand sign : 
 This is just to illustrate the kind of task I need to do.

 I can create the outline by using a path.
 However, I have not been able to see how to create the two holes such 
 that when the paths are painted, they will appear as ... holes.

 Can anyone guide me with this one ?


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

[android-developers] Re: Drawing complex shapes with hollow parts

2012-11-12 Thread Simon Giddings
Thank you for this.
One thing I am not clear with is the problem with hardware acceleration.
Some people say that this will not work with hardware acceleration ON, 
whilst others say that this is precisely what is needed when it is ON.

Is there some definitive answer for this aspect ?

On Monday, 12 November 2012 11:58:07 UTC+1, Piren wrote:


 http://stackoverflow.com/questions/11337679/porterduffxfermode-clear-a-section-of-a-bitmap

 On Monday, November 12, 2012 12:16:17 PM UTC+2, Simon Giddings wrote:

 I am needing to draw shapes which will have hollow regions.
 To simplify the idea, take an ampersand sign : 
 This is just to illustrate the kind of task I need to do.

 I can create the outline by using a path.
 However, I have not been able to see how to create the two holes such 
 that when the paths are painted, they will appear as ... holes.

 Can anyone guide me with this one ?



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

[android-developers] Re: Drawing complex shapes with hollow parts

2012-11-12 Thread Piren
I haven't had any issues with hardware acceleration using porter duff, at 
least not under the circumstances i had to use it in.

just try it and see how it goes.

On Monday, November 12, 2012 1:06:04 PM UTC+2, Simon Giddings wrote:

 Thank you for this.
 One thing I am not clear with is the problem with hardware acceleration.
 Some people say that this will not work with hardware acceleration ON, 
 whilst others say that this is precisely what is needed when it is ON.

 Is there some definitive answer for this aspect ?

 On Monday, 12 November 2012 11:58:07 UTC+1, Piren wrote:


 http://stackoverflow.com/questions/11337679/porterduffxfermode-clear-a-section-of-a-bitmap

 On Monday, November 12, 2012 12:16:17 PM UTC+2, Simon Giddings wrote:

 I am needing to draw shapes which will have hollow regions.
 To simplify the idea, take an ampersand sign : 
 This is just to illustrate the kind of task I need to do.

 I can create the outline by using a path.
 However, I have not been able to see how to create the two holes such 
 that when the paths are painted, they will appear as ... holes.

 Can anyone guide me with this one ?



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

[android-developers] Re: Drawing complex shapes with hollow parts

2012-11-12 Thread Simon Giddings
Great, thanks for this

On Monday, 12 November 2012 15:27:32 UTC+1, Piren wrote:

 I haven't had any issues with hardware acceleration using porter duff, at 
 least not under the circumstances i had to use it in.

 just try it and see how it goes.

 On Monday, November 12, 2012 1:06:04 PM UTC+2, Simon Giddings wrote:

 Thank you for this.
 One thing I am not clear with is the problem with hardware acceleration.
 Some people say that this will not work with hardware acceleration ON, 
 whilst others say that this is precisely what is needed when it is ON.

 Is there some definitive answer for this aspect ?

 On Monday, 12 November 2012 11:58:07 UTC+1, Piren wrote:


 http://stackoverflow.com/questions/11337679/porterduffxfermode-clear-a-section-of-a-bitmap

 On Monday, November 12, 2012 12:16:17 PM UTC+2, Simon Giddings wrote:

 I am needing to draw shapes which will have hollow regions.
 To simplify the idea, take an ampersand sign : 
 This is just to illustrate the kind of task I need to do.

 I can create the outline by using a path.
 However, I have not been able to see how to create the two holes such 
 that when the paths are painted, they will appear as ... holes.

 Can anyone guide me with this one ?



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