How to do continuously drawing of Line, rectangle,polyline and Etc...

Login to reply to this topic.
Tue, 2008-03-11 03:56
Joined: 2007-08-29
Forum posts: 128

Hi All,

I have drawing application in which I am able to draw point,line, polyline, polygon,rectangle, and round rectangle. Now I want to draw this continously . How I will do that. Please give me some hints aur idea so I can draw continuously. I am waiting for reply. Puzzled

Thanks in advance.


Thanks & Regards
Ram

Symbian OS 9.1,S60 3rd edition MR,and CodeWarrior 3.1


Tue, 2008-03-11 08:06
Joined: 2003-12-05
Forum posts: 586
Re: How to do continuously drawing of Line, rectangle,polyline a

What do you mean by "continously"?

Tue, 2008-03-11 08:29
Joined: 2007-08-29
Forum posts: 128
Re: How to do continuously drawing of Line, rectangle,polyline a

Hi Andreas,

Thanks for reply,

In my application I can draw 1)point, 2) Line, 3) Polyline, 4) polygon, 5) rectangle, 6) Round rectangle.
Now I want to draw in order(First point then Line, then Polyline and so on). I want to draw first point and after 1 or 2 second it must draw Line and so on.


Thanks & Regards
Ram

Symbian OS 9.1,S60 3rd edition MR,and CodeWarrior 3.1

Tue, 2008-03-11 09:17
Joined: 2007-09-03
Forum posts: 25
Re: How to do continuously drawing of Line, rectangle,polyline a

Can you use User::After() api?
If you want timed output, you can also go for an object of the CPeriodic class.

Tue, 2008-03-11 09:55
Joined: 2007-08-29
Forum posts: 128
Re: How to do continuously drawing of Line, rectangle,polyline a

Hi Aniait,

Thanks for your reply, Now I understand that I have to use Time function so I can draw after 1 or 2 seconds. I am trying to implement in my application.


Thanks & Regards
Ram

Symbian OS 9.1,S60 3rd edition MR,and CodeWarrior 3.1

Tue, 2008-03-11 18:49
Joined: 2007-09-15
Forum posts: 61
Re: How to do continuously drawing ...

User::After() is a synchronous function and will hang the devide for that period of time. Rather than going for a synchronous process, it is always advisable to better use an asynchronous approach, using CActive or CPeriodic APIs.

Wed, 2008-03-12 03:25
Joined: 2007-08-29
Forum posts: 128
Re: How to do continuously drawing of Line, rectangle,polyline a

HI SymbianReady,

Thanks for your reply. I am going to use CActive and RunL() Method.


Thanks & Regards
Ram

Symbian OS 9.1,S60 3rd edition MR,and CodeWarrior 3.1

Wed, 2008-03-12 11:03
Joined: 2004-11-29
Forum posts: 1134
Re: How to do continuously drawing of Line, rectangle,polyline a

Just a small note:
User::After does not "hang the device", it will suspend the thread from within it is called, for the specified time.
The problem, and advantage, with it is though that it will suspend the thread at the exact point where it is called, so no active objects can be handled in that thread during the suspension.
Other threads in the device will continue to run as if nothing has happened.

And a tip:
I'd suggest you use CTimer instead of the raw CActive if you want a timer AO.
No need to invent the wheel twice.

Wed, 2008-03-12 12:12
Joined: 2007-08-29
Forum posts: 128
Re: How to do continuously drawing of Line, rectangle,polyline a

Hi Alh,

Thank you for reply. I want AO timer so I can use CTimer. I search in SDK and found that CTimer is derived from CActive. and CPeriodic is derived from CTimer. It is good for me to giving information about User::After.


Thanks & Regards
Ram

Symbian OS 9.1,S60 3rd edition MR,and CodeWarrior 3.1

Wed, 2008-03-12 14:14
Joined: 2004-11-29
Forum posts: 1134
Re: How to do continuously drawing of Line, rectangle,polyline a

Yes.

CActive is the base class for all AO, so all AOs is naturally derived from CActive.

CTimer is good to derive your class from if you want to create a new class which main function is being a timer that does something on a regular interval.

CPeriodic is very useful if you already have a class that is based on CBase, for example a view, but need to slap on a timer to it to do something special.
CPeriodic should not be derived from any further.

Wed, 2008-03-12 19:06
Joined: 2007-09-15
Forum posts: 61
Re: How to do continuously drawing of Line,...

Acknowledged. Used wrong words. Thanks for the correction Mr. Hedman.

  • Login to reply to this topic.