|
-
Aug 15th, 2001, 06:17 PM
#1
Thread Starter
New Member
Unoccupied window-space
In my application i put an array of labels at random places.
When placing the labels, i need to find all areas of the form, not allready occupied by labels.
Is there any way i can do this ?
Many thanks in advance.
-
Aug 16th, 2001, 02:28 AM
#2
Fanatic Member
When loading the label randomly, you need to have 2 random numbers (for top and left).
If you store these two number into a dynamic array, each time you generate another pair, make sure they are not in the range covered by previous labels.
For example: if first pair is (5,10) and label height, width is (20,50).
Thus you have a rectangle of coordinates (left, top properties)
1. Top left corner (5,5)
2. Top right corner (5,60)
3. Bottom left corner (25,60)
4. Bottom right corner(25,60)
If you get the rectangle, then you can use the polygon clipping techniques to get what you want.
Regards.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|