For example, I have a screen size of 1024x768. And, each of my images is 150 x 250, where I have a total of 4 images. How can I randomize these images to appear on different positions on the screen?
What do you really want? What's this:
- Keep 4 predefined spaces and randomly assign each 4 image to an empty space,
- Or just randomly place them on the screen Keep it?
This idea is to display images and take care of every shape object (H1, H2, H3, H4). Ideally they have to be stored in a handle list H. For the first consideration, store the top-left corner position of each empty space in the POS list of 4 entries. Make connectivity list LC where LC [I] = J poin indicates where HH [I`] to know the status of. For example, if LC = [1 2 3 4] handles HO then POS status, H2 is assigned to POS [2], etc. ... then use the random () () () like That Ashish told on the LC list. This will randomly "mix" the connectivity list, and therefore, at the end, drag the situations to the position of each handle:
set (h [i], 'position', [pOS ( LC [i], 1) POS (LC [i], 2) SizeX]];
Where there is sizeX and sizeY size ratios between the shape and the screen
Comments
Post a Comment