| Reply | « Previous Thread | Next Thread » |
|
Is there anything in the existing PYS60 library which allows you to check whether an x,y coordinate is within a rectangle drawn on the screen.
Thanks Dinnerdog |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Online
Forum Nokia Champion
|
|
|
Quote:
AFAIK there is no direct method to do what you want. But you can make your own algorithm for that like making your rectangle and then check wheather the coordinates can be compared or not. Sorry this is just a hint. Enjoy Pythoning Gaba88 Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
There is nothing built in but it is relatively easy to make your own function to do this. You only need to know the coordinate of the given point and the coordinates of the rectangle.
Code:
def pointInRect(p,rect):
if p[0]>=rect[0] and p[0]<=rect[2] and p[1]>=rect[1] and p[1]<=rect[3]:
return True
return False
#Rectangle format must be top left corner first and then the bottom right corner
rect = [10,10,20,20]
point = [12,13]
print pointInRect(point,rect)
hope that helped ![]() Nokia E66 PyS60 1.4.4 final |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| drawing a rectangle | Jeepy | General Symbian C++ | 5 | 2009-01-19 11:39 |
| Transparant Rectangle, possible ? | Tiger79 | Mobile Java General | 4 | 2008-08-22 16:24 |
| Help me to draw line and rectangle | RB_Sahu | Symbian User Interface | 6 | 2008-03-10 11:40 |
| Drawing rectangle | usuf | Symbian Media (Graphics & Sounds) | 6 | 2008-01-18 07:31 |
| Efficiency: drawing rectangle or using label | xhsoldier | General Symbian C++ | 6 | 2008-01-07 07:24 |