|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Topic # 1420 |
PENX and PENY |
28/05/2006 @ 14:25 by Garfield
|
Hi
I've noticed that PENX and PENY will only return values between 0 and 159, even if the screen has been set to high resolution.
Shouldn't PENX and PENY also respect high resolutions?
Thanks.
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1 -------- 28/05/2006 @ 15:39 by aldweb
visitor |
Hi Garfield,
The Palm HighRes APIs is some kind of hack on a system built to work in lowres only. As stated in the user manual, this how you should always proceed in your code, to work quite smoothly with this kind of stuff (due to Palm OS and I did not want to get things to complex in the code to have iziBasic handle highres mode in a smoother way): 1. switch to highres 2. draw some thing(s) 3. switch back immediately to lowres Never remain in highres.
Then, PENX and PENY do not draw, they retrieve some values, this is why they stick in the [0..159] range. Furthermore, 1 pixel out of a 160x160 pixels resolution is already more precise than the tap of a stylus on the screen!
Cheers,
@+ aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 2 -------- 29/05/2006 @ 04:42 by bh77a
visitor |
For drawing on screen with a pen in high res, try this (the original code is Aldweb's from a ways back in the forums but modified by me). This should give you one way to
BEGIN R=HIGHRES(1) REPEAT E=DOEVENTS IF E=1000 THEN p=PENDOWN IF p=1 IF q=0 LET x=PENX*2 : y=PENY*2 : PSET x,y IF p=1 IF q=1 LET x=PENX*2 : y=PENY*2 LINETO x,y q=p ENDIF UNTIL E=-1 R=HIGHRES(0) END |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 3 -------- 30/05/2006 @ 22:15 by aldweb
visitor |
Yes, this is smart and quick.
Cheers, aldweb
|
|
|
topic active
topic closed
Sticky
New message -
Correct message
Close topic
Make sticky
|
|