PC Review


Reply
Thread Tools Rate Thread

Re: Double buffering child controls

 
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      27th Jun 2006
The best place to ask .NET CF questions is
microsoft.public.dotnet.framework.compactframework. I've added this to the
distribution list for the question.

Paul T.

"Dan McCarty" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Sorry, thought you were doing this in C/C++. I haven't done this in
> managed code.
>
> (A common way to fake control panels is to draw a single large bitmap
> to look like your buttons. If your primary objective is flicker-free
> drawing, this may be the best way to go. If you need dynamically-drawn
> buttons and more flexibility you're probably better off sticking with
> the standard C# way.)
>
> -Dan
>
>
> Gerald wrote:
>> Hi Dan,
>>
>>
>> To clarify,
>>
>> i am using C# Compact FrameWork 2.0
>>
>> I know how to subclass a single control and double buffer it, but the
>> problem are child controls. I have for example a panel control
>> consisting of 15 button controls. I want the panel control to double
>> buffer all painting of the child controls so i can blit the entire
>> image (Panel AND buttons) in one go.
>>
>>
>> The problem Now is if double buffer the panel, only the Panel drawing
>> is double buffered, not the drawing of all the buttons on that panel,
>> and that is what i am looking for.
>>
>> --

>



 
Reply With Quote
 
 
 
 
Gerald
Guest
Posts: n/a
 
      28th Jun 2006
Thnx paul,

will monitor that tread for an answer.

 
Reply With Quote
 
pdr75
Guest
Posts: n/a
 
      28th Jun 2006
I'm not 100% certain that this will work, but you can try it:

override your panel control's OnPaint method (if you haven't already),
and create a new PaintEventArgs to pass into the base.OnPaint() method,
setting the Graphics property of the new arguments to be the graphics
object from your double buffer.

Something like this:

protected override OnPaint(object sender, PaintEventArgs e)
{
....do your custom drawing here....

PaintEventArgs pe = new PaintEventArgs();
pe.Graphics = (your double buffer graphics context)

..copy clip region etc from event args passed into this method to
your new PaintEventargs

//call base with modified PE
base.OnPaint(sender, pe);
}

Gerald wrote:
> Thnx paul,
>
> will monitor that tread for an answer.


 
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
double buffering in child controls ssoffline Microsoft C# .NET 3 23rd Oct 2006 11:41 AM
double buffering =?Utf-8?B?Um9iZXJ0IFNtaXRo?= Microsoft VB .NET 1 5th Nov 2005 02:40 AM
Double buffering a groupbox =?Utf-8?B?RGFuIE5lZWx5?= Microsoft C# .NET 2 25th Aug 2005 03:09 PM
Double Buffering in ASP.NET Sandeep Microsoft ASP .NET 2 10th Aug 2004 06:55 PM
Re: double buffering Dmitriy Lapshin [C# / .NET MVP] Microsoft C# .NET 2 7th Aug 2003 03:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:10 AM.