You will need to keep track of the drawn path segments in some data 
structure. When you add a new path segment you need to perform an 
intersection test between the new segment and the old ones.

There are two problems with that:

1. The path data structure grows bigger and bigger the more you paint. 
Testing for a line intersection will become slower and slower over time 
unless you apply some advanced optimization techniques like using a spatial 
data structure for quickly retrieving just a sub-section of all relevant 
path segments to test for intersection.

2. There are different kinds of path segments. Straight line segments are 
the easiest to test for intersection. However, you are most likely dealing 
with Bézier curve path segments and that makes the intersection test more 
difficult.

You could try and find an Android port of the AWT geometry 
classes<http://docs.oracle.com/javase/6/docs/api/java/awt/geom/package-summary.html>.
 
There is a class called Path2D which is able to pull off exactly what you 
need. You can build a path with it and test for intersections.


On Monday, February 4, 2013 6:08:23 AM UTC-6, Dilip Kumar Chaudhary wrote:
>
> ok let me read once again Thanks
>
> On Mon, Feb 4, 2013 at 5:21 PM, skink <[email protected] <javascript:>>wrote:
>
>>
>>
>> Dilip Kumar Chaudhary wrote:
>> > I'm asking help with some example sir
>> >
>> >
>>
>> did you bother to read the very first link? or you want me to read it,
>> copy and paste the working code here?
>>
>> pskink
>>
>> --
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to 
>> [email protected]<javascript:>
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "Android Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
> -- 
> *Thanks & Regards*
> Dilip Kumar Chaudhary
> My Linkedin 
> Profile<http://in.linkedin.com/pub/dilip-kumar-chaudhary/44/64/55b> 
> My Development Blog <http://dilipdevelopment.blogspot.com/>
>  

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to