PC Review


Reply
Thread Tools Rate Thread

400 usercontrols to display take too much time - any solution?

 
 
Picander
Guest
Posts: n/a
 
      18th Mar 2005
hello,

I am developing a boardgame, with a large number of customed
usercontrols ( e.g. 20 X 20 = 400 ).
I find it very usefull to use usercontrols, as they can contains
specific properties and methods, but it makes the application very
slow to redraw, even if I redraw only a small subset of them.

Is there a way to speed up the drawing time? I included in my codes
those lines:

this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.UserPaint, true);

but it does not really help.

Is there a way to remove all unused standard methods of the
usercontrol? Any suggestions?

thx,

picander
 
Reply With Quote
 
 
 
 
Bob Grommes
Guest
Posts: n/a
 
      18th Mar 2005
The presence of a lot of methods won't have an appreciable impact on
performance -- in fact, as far as I know, no impact other than large code
size taking memory away from other things, but remember, unlike with
instance data, there is just one copy of the code in memory per class, not
per instance. And if you don't call a given method, it's never JITted, so
there shouldn't be any overhead there.

Are you certain that drawing time is the bottleneck? There could be a lot
of other sources of the problem. If you haven't already, do some profiling
to see what is really soaking up the time. And be sure to profile and
benchmark in a non-debug version.

--Bob

"Picander" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> hello,
>
> I am developing a boardgame, with a large number of customed
> usercontrols ( e.g. 20 X 20 = 400 ).
> I find it very usefull to use usercontrols, as they can contains
> specific properties and methods, but it makes the application very
> slow to redraw, even if I redraw only a small subset of them.
>
> Is there a way to speed up the drawing time? I included in my codes
> those lines:
>
> this.SetStyle(ControlStyles.DoubleBuffer, true);
> this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
> this.SetStyle(ControlStyles.UserPaint, true);
>
> but it does not really help.
>
> Is there a way to remove all unused standard methods of the
> usercontrol? Any suggestions?
>
> thx,
>
> picander



 
Reply With Quote
 
Frank Hileman
Guest
Posts: n/a
 
      18th Mar 2005
If you create custom graphical objects, that know how to draw and hit test,
they will be much faster than controls. This way you use only a single
control.

Regards,
Frank Hileman

check out VG.net: http://www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor

"Picander" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> hello,
>
> I am developing a boardgame, with a large number of customed
> usercontrols ( e.g. 20 X 20 = 400 ).
> I find it very usefull to use usercontrols, as they can contains
> specific properties and methods, but it makes the application very
> slow to redraw, even if I redraw only a small subset of them.
>
> Is there a way to speed up the drawing time? I included in my codes
> those lines:
>
> this.SetStyle(ControlStyles.DoubleBuffer, true);
> this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
> this.SetStyle(ControlStyles.UserPaint, true);
>
> but it does not really help.
>
> Is there a way to remove all unused standard methods of the
> usercontrol? Any suggestions?
>
> thx,
>
> picander



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Design time support for components an UserControls Efy Microsoft Dot NET Framework 3 24th Apr 2009 06:18 PM
Design time support for components an UserControls Efy Microsoft Dot NET Framework Forms 0 24th Apr 2009 01:18 AM
Adding usercontrols to other usercontrols =?Utf-8?B?RW1tYQ==?= Microsoft C# .NET 2 27th Oct 2004 03:07 PM
cannot move usercontrols in design time using mouse =?Utf-8?B?c2FocmlkaGF5YW4=?= Microsoft Dot NET Framework Forms 2 30th Aug 2004 04:31 AM
rebuild solution automaticly each time im running the solution in the ide Daylor Microsoft Dot NET 1 24th Sep 2003 05:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:23 PM.