Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Buffer swapping
Does anyone know how to do flicker-free animation in GDI+? In GDI, you could
define memory device contexts, draw to them, and then blt the result to the
actual window context. So far, I've been unable to find a corresponding way
of doing things in GDI+

Any ideas?



Report this thread to moderator Post Follow-up to this message
Old Post
toa
11-21-04 08:58 AM


Re: Buffer swapping
You can do this in one of two ways.

1. Use automatic double buffering in windows forms.  In the
constructor or form load event, simply execute this statement

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

2. If you want to do it manually, simply specify a globally scoped
Bitmap object, draw to that, then draw the finished image to the
screen in one shot.  So something like:

private Bitmap imgBuffer;

...

Graphics g = Graphics.FromImage(this.imgBuffer);

Hope that helps,
Joel Martinez
Orlando .NET User Group
http://www.onetug.org
http://www.codecube.net


"toa" <toalmark@hotmail.com> wrote in message news:<iA3md.7925$rh1.201557@news2.e.nsc.no>..
.
> Does anyone know how to do flicker-free animation in GDI+? In GDI, you cou
ld
> define memory device contexts, draw to them, and then blt the result to th
e
> actual window context. So far, I've been unable to find a corresponding wa
y
> of doing things in GDI+
>
> Any ideas?

Report this thread to moderator Post Follow-up to this message
Old Post
Joel Martinez
11-22-04 08:58 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

C# archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:22 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.