Re: GDI+ Metafiles

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Mike D Sutton (EDais_at_mvps.org)
Date: 02/17/05


Date: Thu, 17 Feb 2005 09:06:42 -0000


> Hi Mike! No, I'm not tied to a GDI+ metafile, but I have written code that
> uses GDI+ drawing methods. I can't figure out how to make them work
> (drawing with an alpha channel) in a normal metafile.
>
> This project is a continuation of one that you were helping me with quite a
> while ago. Basically, you and Alpine convinced me to, instead of creating a
> drawing layer and redrawing every object on demand, draw all of my objects
> as metafiles and then just play them as needed. That worked great.
>
> However, now we have moved from straight GDI to GDI+. You just responded to
> another of my posts from the 12th about Alphablending. We moved to GDI+
> because of its support for this. However, you just scared me when you
> posted "having to use the slow and clunky GDI+. " Is it slower than GDI?

I've never done any testing myself, but everything I've read on the subject seems to point to that conclusion. It's
device independence and graphical 'niceties' such as anti-aliasing, pixel centring etc add additional overhead to the
routines, and since the majority of it is built over the top of the existing GDI infrastructure it's quite impossible
for it to be faster.

> Yeah, jumping into designing a type library with API calls that I don't know
> how they work doesn't seem like the quickest route to success. Then again,
> I WOULD like to learn the theory behind type libraries...

Here's an article on the subject I found recently whilst helping another poster, it may be of some interest to you:
http://www.devx.com/vb2themax/Article/19830/1763/page/1
Hope this helps,

    Mike

 - Microsoft Visual Basic MVP -
E-Mail: EDais@mvps.org
WWW: http://EDais.mvps.org/



Relevant Pages

  • Re: OnPaint Function Issue
    ... I assume that by double-buffering that you mean using the GDI type Windows ... API functions like BitBlt where all drawing is done to a off sreen memory ... As far as I am aware there are no memory device contexts or bitblitting ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: The story: Painting bitmap to screen is slow
    ... The general "trick" behind great GDI+ performance is to do all drawing ... single bitmap to the screen. ... I heard Microsoft broke GDI acceleration for some operations in Vista. ... your configuration of Vista or graphics driver. ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: GDI+ Performance Question
    ... what is this Canvas object that you are using for drawing? ... I've been reading alot about how GDI+ does not ... The rendering algorithm is pretty sound, it'll only render the parts of the score that need to be. ... For performance reasons, I'm drawing to a bitmap and during scrolling, I'm actually only rendering parts of the bitmap, in order to keep performance under control, but I don't like that approach. ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: GDI+ Metafiles
    ... > uses GDI+ drawing methods. ... > (drawing with an alpha channel) in a normal metafile. ... Here's an article on the subject I found recently whilst helping another poster, it may be of some interest to you: ...
    (microsoft.public.vb.winapi.graphics)
  • Re: Pen width difficult to control with scaled graphics
    ... There doesn't seem to be a workaround except drawing some of the graphics at scale and then others unscaled using the matrix but scaled manually. ... Answer those GDI+ questions with the GDI+ FAQ ...
    (microsoft.public.dotnet.framework.drawing)