aldweb

Close I. aldweb

Close II. PC Freeware

Close III. Palm Freeware

Close IV. Palm Shareware

Close V. iziBasic Palm

Close VI. Palm Knowledge

Close VII. Pocket Computer

Close VIII. miniPortail

Special !



Mobile version of
the aldweb Site

m.aldweb.com


Neither French, nor English?

Try one of these flags then:
[de] [es] [it] [pt]
Search




Weather / Spam / www

Lyon Weather


aldweb against spam


Newsletter
To receive news about this website, consider subscribing to our Newsletter.
Subscribe
Unsubscribe
298 Subscribers
Family's web sites

Webmaster - Infos
Friends News
Visits

   visitors

   visitors online

Poll
What do you think of the new design of the aldweb Site?
 
Great !
Beautiful
Average
So ugly...
Results
forum.gifForum - iziBasic - Topic #1469

Forum - Forum
iziBasic - iziBasic


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257

active  Topic # 1469  Drawing on Screen

30/10/2006 @ 19:20
by Garfield

Anonymous



Hi Everyone

I'm writing a program in which I want to allow the user to draw on the screen. I don't need to record what they're drawing nor do I need to save it or anything - I just want to let them draw within a fixed area of the screen.

The code which allows them to do this is as follows:

REPEAT
E=WAITEVENT
IF E=1000 GOSUB _Draw
...
UNTIL E<0

_Draw:
i=PENDOWN
IF i=0 RETURN
x=PENX:y=PENY
IF y<16 RETURN 'if not within the defined
IF y>99 RETURN 'area then exit subroutine
COLOR 255 'Assumes non-BW screen
PSET x,y
REPEAT
LINETO x,y
E=DOEVENTS
i=PENDOWN:x=PENX:y=PENY
IF y<16 i=0 'if not within the defined
IF y>99 i=0 'area then exit subroutine
UNTIL i=0
RETURN

Now, this works fine except that it's quite slow. The response is sluggish and if I were to draw a circle it would look more like an octagon than a circle. Also, if I draw something quickly it may not capture it at all.

Am I missing something or is this simply one of iziBasic's limitations? If so, does anyone have an applet that I can call to allow the drawing routine? I'm sure a PP applet would give the user the same sort of response that Note Pad does.

Any help/suggestion would be welcome.

Thanks.
  Post an answer  Top

[]   


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1
--------
31/10/2006 @ 11:41
by aldweb

Anonymous

visitor
Hello Garfield,

Your program runs very smoothly and fast in my Tungsten C. The circles I draw are not perfect because I am not too good at drawing circles but they look much more like circles than octagons. I could even write my first name without any special issue.

Your source code may still be optimized a little bit though But I did not notice any huge improvement in the drawing speed as this one was already good with your source code...

_Draw:
x=PENX : y=PENY
i=PENDOWN*(y>=16)*(y<=99)
IF i=0 RETURN
COLOR 255
PSET x,y
REPEAT
LINETO x,y
E=WAITEVENT
x=PENX : y=PENY
i=PENDOWN*(y>=16)*(y<=99)
UNTIL i=0
RETURN


A few hints:
- calculations (i=) should always be faster than tests (IF i=)
- no need to scan with DOEVENTS in this case, a WAITEVENT is better as it should capture the very first event a little bit faster than the DOEVENTS loop which lets go some empty events through the REPEAT/UNTIL loop

Please let me know if you get better performance with these few changes in your source code?

Cheers,

@+
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 2
--------
31/10/2006 @ 18:20
by Garfield

Anonymous

visitor
Hi Aldweb

Thanks for your answer. It's always good to know faster ways to achieve the same effect. :)

However, after making the changes I haven't noticed very much difference. If I draw at a moderate speed then it does perform well. However, what happens if you sign your name at the speed that you normally sign your name? Does it get captured correctly? Or is that too fast? If I sign my name as I would sign a cheque it looks nothing like what I have drawn. How does yours perform?

For your info, I'm using a Palm T3 which should be more than fast enough.

Please let me know.

Thanks.
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 3
--------
31/10/2006 @ 23:25
by aldweb

Anonymous

visitor
Hello Garfield,

Here are snapshots made with Snap on my Tungsten C:


Left circle was drawn at the normal speed, when I paid attention to drawing a nice circle.
Right circle was drawn as fast as I could and, indeed, there are some straight lines sometimes.


Signing at normal speed.


Signing as fast as I could and, indeed, there are some lines instead of nice curve letters.

Cheers,


@+
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 4
--------
01/11/2006 @ 17:42
by Garfield

Anonymous

visitor
Hi Aldweb

Many thanks for getting back with such a detailed response.

It looks like the software works fine on your Palm. I don't have Snap to show you what happens on my T3, but I can assure you that if I draw a circle quite fast I can even end up with a triangle! If I sign my name, it looks like a few random lines.

Could I have something else running on my Palm that is slowing it down? Could the T3 have a slow screen response? I can't understand why it would work so well on yours and so badly on mine.

Do you have any ideas?
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 5
--------
01/11/2006 @ 18:01
by aldweb

Anonymous

visitor
Hello Garfield,

The Tungsten T3 is a device which is almost just as fast as the Tungsten C. Not only the CPU has the same beat, but all benchmark parameters are very good according to my award winning benchmark software being Speedy, at least in Portrait mode (the Landscape mode was a little bit less performing, this was enhanced in later devices like the T5 and the TX), all Speedy reference results can be seen online here: http://www.aldweb.com/articles.php?lng=en&pg=19.

Then, as you could see from the above snapshots, I am using the PalmRevolt skinning application which is known to have an effect on performance, especially on the display speed (about 20% decrease of performance), which is the factor important when considering your application.

Then, I don't have a single clue why performance is not OK in your T3 for this application.

What I suggest is that you try to hard reset your device (after having done at least 2 full backups - remember that HotSync is not a good backup software, use another one...), install only your application and check if you still get bad performance.
If everything runs smoothly at this stage, then, indeed, one or more 3rd party application(s), probably running in the background, have a bad effect on your application's performance.
But why would this be when my own test on a similar device, a Tungsten C, with the PalmRevolt skinning application running came with good performance?

On my side, I will test in an old Palm Vx, running a 20MHz processor. We'll see... You may do the same with any older device you own.

Cheers,


@+
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 6
--------
02/11/2006 @ 18:47
by Garfield

Anonymous

visitor
Hi Aldweb

Many thanks for your help. I'm always reluctant to hard reset my device as my synchronisation with Outlook Exchange always does funny things when I do hard reset my device, so I'll believe you!

What I will do is try it out on other devices (my wife's Tungsten T and my brother's Sony) and see how it works.

Thanks.
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 7
--------
03/11/2006 @ 09:07
by Garfield

Anonymous

visitor
Hi Aldweb

Well, I've tried it on my Dad's Tungsten E and it works fine, much better response than my T3. It must be something I'm running on my Palm that's causing it, and knowing that is good enough for me!

Thanks for your help.
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 8
--------
05/11/2006 @ 17:48
by aldweb

Anonymous

visitor
Hi Garfield,

To end-up with my own tests, on a very old device being a Palm Vx (running an old DragonBall @ 20 MHz):

Drawing a circle as fast as possible could lead to getting a square!
But I think this is quite to be expected on such an old device.

Drawing with care, I got a much nicer circle than with my Tungsten C (which has an ARM proc @ 400 MHz - so about 20 times faster than the Vx).

Cheers,
aldweb


@+
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 9
--------
13/11/2006 @ 09:58
by aldweb

Anonymous

visitor
Hello Garfield,

Even though you have a T3, there seems to be some similar issues with Grafiti on the T5 and the TX.
Read here: What on earth did Palm do to grafitti in their NVFS devices?

Wouldn't your T3 suffer from this kind of problem?

Cheers,
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 10
--------
13/11/2006 @ 15:45
by Garfield

Anonymous

visitor
Hi Aldweb

Nope, my T3 doesn't suffer from this. The writing is fine in the graffiti area, and if I load up Note Pad, no matter how fast I draw, my circles are always round, never octagonal or any other multi-sided polygon, and believe me I've drawn circles as fast as I possibly can!

I only have this problem with my iziBasic program. Everything else works fine. To be honest, I'm pretty sure that if I hard-reset my T3 it would then work fine. I just don't want to go through that hassle. Knowing that it works on your Palm and on my Dad's Tungsten E has convinced me that it's just my T3 doing something funny.

However, if anyone else with a T3 wants to give it a go please go ahead and let me know the results.

Thanks.
  Post an answer  Top
active topic active   closed topic closed   Sticky Sticky   New New message   -   Correct Correct message   Close Close topic   Make sticky Make sticky
[]
Forum Topic  Forum 



 
^ Top ^