×

Discussion Board

Results 1 to 4 of 4

Thread: Random Clipping

  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    45

    Question Random Clipping

    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.

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: Random Clipping

    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,

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    45

    Re: Random Clipping

    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

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: Random Clipping

    Quote Originally Posted by dineshdreamworld View Post
    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,

Similar Threads

  1. javascript random NOT random
    By captain_dixie in forum Symbian
    Replies: 2
    Last Post: 2009-05-24, 02:33
  2. Random RingTone within Contact List for 3rd
    By cckfranky in forum Symbian
    Replies: 5
    Last Post: 2007-12-29, 18:33
  3. Problems with random nubers ...
    By IngeSchmidt in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2004-07-27, 16:39
  4. Problems in getting random numbers
    By Smori2002 in forum Mobile Java General
    Replies: 3
    Last Post: 2003-11-18, 13:42
  5. problem with Random()
    By doomer999 in forum Mobile Java General
    Replies: 2
    Last Post: 2003-05-05, 15:16

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×