Can anybody pls tell me how can a random clipping can be done. I have stored the clipping co-ordinates in an integer array so how can i randomly choose those co-ordinates from that array and clip that region.
Can anybody pls tell me how can a random clipping can be done. I have stored the clipping co-ordinates in an integer array so how can i randomly choose those co-ordinates from that array and clip that region.
Hello,
You have to take the two arrays, one for the X another for the Y,
if your width and heights are not changing then you can keep these two in two variables, else you have to take the 2 different arrays for the width and height too.
Then you can pic index out of your arrays length. Means lets say your array size is 10 then you can find the random number between 0 and 9, and then for that index you can read the values from the X, Y Width and Height arrays respectively.
Since you have all the required 4 values then you can easily set the clip,
Thanks with Regards,
R a j - The K e r n e l
Join Delhi-NCR Nokia Developer's Community,
Hello Raj can u tell me how can i find that random no betn 0 to 9. As u mentioned i hav all the required arrays but just i need to pick the randown x and y alnog with its width and height and after that set the clipping method but i dont know how can i pick the random value i.e the array no. Pls tell me
You can use the Java In built class called as "Random", it has got the various methods,you can use the same.
http://www.cs.geneseo.edu/~baldwin/r...ce/random.html
http://www.javapractices.com/topic/TopicAction.do?Id=62
Thanks with Regards,
R a j - The K e r n e l
Join Delhi-NCR Nokia Developer's Community,