BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: Using Canvas->Handle is 1000 times slower

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics)
View previous topic :: View next topic  
Author Message
zhang li
Guest





PostPosted: Thu Jun 26, 2003 1:51 pm    Post subject: Re: Using Canvas->Handle is 1000 times slower Reply with quote



I also thought the speed question of VCL component.

The "property" not a real data, even use it like a data.
it has via a function call, after return data type, so be slow.

C++Builder keyword extensions

<property declaration> ::=

__property <type> <id> [ <prop dim list> ] = "{" <prop attrib list>
"}"



regards


Li

Quote:
for (int i = 0; i < 1000;i++)
Draw(Form1->Canvas->Handle,pic);

because the results were on the slow side (12ms per draw Av) I decided to
optimize, and instead of getting the HDC each time I called it once at
the beginning of the function, stored the results and used that in the
loop

eg:
HDC hdc = Form1->Canvas->Handle;
for (int i = 0; i < 1000;i++)
Draw(hdc,pic);

SHOCK and Amazement!!!

my drawing routines increased in speed by 1000





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.