Re: Paint a graph

From: Fabian Schmied (REMOVETHISfabianDOTschmied_at_fhs-hagenbergDOTacDOTat)
Date: 05/12/04

Date: Thu, 13 May 2004 00:54:29 +0200

maka3 schrieb:

> Thanks for your answers. I have decided to take bitmaps for the
> circles, it's faster. Can you explain me why?

Because DirectDraw can do BitBlts (bit block transfers, i.e. copying
bitmaps) itself, very fast, usually hardware-accelerated. The other
Draw... methods are performed by GDI. That means, an HDC is requested
for the surface, GDI is used to draw the object, the HDC is released.
Both the HDC request and the GDI drawing are slow, so using bitmaps (or
actually, other surfaces) for drawing is faster.

> How would you draw a graph? Is there another way as saving all
> coordinates in a collection and call DrawLine for each pair?

Yes, I'd probably do it that way. Although it may be more efficient to
call GetDC() once and p/invoke Polyline.


Relevant Pages

  • Create and array of Bitmaps using GDI+
    ... I've figured out how to create images (bitmaps) with GDI+, ... HDC hdc = GetDC; ...
  • Re: GDI zoom
    ... in one line of code and without the additional dependency of GDI+. ... Similar tasks with bitmaps are very difficult in vb6. ... however trying to use this case as a reason ... There is a huge amount of added functionality. ...
  • Re: Unknown pointer problem between Visual Basic and C (problem solved)
    ... MyMethod (ByVal hdc As Long) ... > Rest of software was built in Visual C (to access C libraries from third ... I send a bitmap hdc pointer from ... > and C draws all bitmaps in the perfect way. ...
  • Re: a newbie needed help on DIB and DirectShow
    ... > was not a Win App developer and so I didn't have much knowledge on GDI+. ... If you want to produce moving video on the screen then DirectShow is the ... allow you to build a graph showing Device Independant Bitmaps fery ... If you have a bitmap (DIB) in a file that you simply want to show on the ...
  • Re: Background effects
    ... > This is a function of bitmaps rather than GDI+. ... > Find great Windows Forms articles in Windows Forms Tips and Tricks ...