Re: c# and GDI graphics
- From: "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 15 Sep 2006 12:18:34 -0400
Daniel,
It is possible, but the one main advantage that the DirectX solution has
over the GDI app is that DirectX is going to utilize hardware acceleration
when it can, whereas GDI won't (you are simply pushing pixels to the screen
there, very low level).
If your requirements and your development permit (XP/2003 and above,
don't mind using the .NET 3.0 framework which is not even in beta yet), you
might want to try using the Windows Presentation Foundation. It will give
you the benefits of hardware acceleration (it utilizes DX underneath the
covers) and an easy programming model.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
"Daniel" <DanielV@xxxxxxxxxxxxxxxx> wrote in message
news:%23DggsKL2GHA.4476@xxxxxxxxxxxxxxxxxxxxxxx
Hi
I had an app i write on DirectX that will nearly always run in a windowed
situation. It could also have many instances running at a time and as such
to keep the cpu usage down i had a frame refresh sticker ever 32 ms rather
than maximum speed. This worked great but then i thought as all my
graphics are 2D this is huge over kill.
So i decided to port it to GDI graphics. At first a good idea i could
easily do everything i was using with Directx but less end requirements
for the user and much smaller code and less 'set up' code.
However first i found severe flicker with the GDI solution. So i
implemented a double buffer which solved the flicker but all my
transparent imagery was lost (due to the doubling up). I found if i clear
the back buffer to prevent doubling up i get a flicker again.
this all aside a even bigger problem, my cpu usage is FAR worse than it
was with directx. With a refresh every second it still spikes to 18% for
one instance. I have seen rival products on the market use simple graphics
who keep the cpu under 5% when i had 10 instances open.
What am i doing wrong? Is it possible to make an efficient GDI app?
.
- References:
- c# and GDI graphics
- From: Daniel
- c# and GDI graphics
- Prev by Date: Re: How do I reference my new class?
- Next by Date: Re: multiple same section in app.config
- Previous by thread: c# and GDI graphics
- Next by thread: Duplicate file checker in C#?
- Index(es):
Relevant Pages
|