Thread: Drawing 3D pie charts

  1. #1
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,273

    Question Drawing 3D pie charts

    Hi,

    Does anyone know how the disk space 3D pie charts from viewing a drive's properties in Explorer are drawn? Is there an API function or DLL that would allow me to do this?

  2. #2
    Barjor
    Guest
    I know there is an ActiveX control that does it. Sorrry I don't remeber it's name or where it is to be found.
    ~Barjor

  3. #3
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    Use GetDiskFreeSpace() or GetDiskFreeSpaceEx() to get the number of bytes on the disk and the number of free bytes.
    Basic maths will give you your pie chart angles. Then use GDI functions to draw and fill your pie chart.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  4. #4
    Registered User minime6696's Avatar
    Join Date
    Aug 2001
    Posts
    267

    Talking Way to go!

    Way to go Stoned_Coder... people should do it themselvs more often on this board!

    SPH

  5. #5
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,273
    Pffft, I'm already doing that!

    But there doesn't seem to be any GDI functions to draw 3D pies. I would concoct a rather weird procedure involving drawing the same pie several times (incrementing the y coords to give the pie depth), but that sounds too much like hard work for both me and my CPU

  6. #6
    Registered User minime6696's Avatar
    Join Date
    Aug 2001
    Posts
    267

    Post Nah...

    Not really, just 1 pie, then draw a little curve thing under it (of the same degree as the pie's edge), workx like a charm .

    SPH

    P.S. If you really want it to look good, draw little lines down from the "ends" of the "peice of pie division lines" down to thier correspondent pixel on the 'little curv thing', and if you really wanna get fancy, fill the dived areas in between the 'little curve thing' and the pie chart.

    P.S.S. You may even consider scaling the pie chart as you draw.. to create a "depth" effect... Simple formulas, but they make a BIG difference.
    Last edited by minime6696; 02-01-2002 at 05:41 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Odd 3D Invis Objects?
    By Zeusbwr in forum Game Programming
    Replies: 4
    Last Post: 12-07-2004, 07:01 PM
  2. Drawing Simple Bar Charts (Stats Question)
    By Davros in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 11-10-2004, 07:23 AM
  3. 3D starfield
    By VirtualAce in forum Game Programming
    Replies: 6
    Last Post: 06-26-2003, 12:40 PM
  4. 3D SDK for C++ programmers
    By chand in forum Game Programming
    Replies: 2
    Last Post: 05-20-2003, 07:38 AM
  5. 3d engines
    By Unregistered in forum Game Programming
    Replies: 7
    Last Post: 12-17-2001, 11:19 AM