Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. GDI Gurus, Ellipses

GDI Gurus, Ellipses

Scheduled Pinned Locked Moved C / C++ / MFC
c++cssgraphicsquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Abin
    wrote on last edited by
    #1

    I just wonder how ::Ellipse and ::ArcTo were implemented(or CDC::Ellipse, CDC::ArcTo in MFC library), I really wish I could have a chance to see the source code of those functions, or less than that, an idea how it was possible to draw an ellipse(not a circle) on the screen, by being given a mere boundary rectangle. I guess there got to be a lot of plane geometry involved, hell, wouldn't it be terribly time consuming to calculate coordinates of every single point on the arc?

    D F 2 Replies Last reply
    0
    • A Abin

      I just wonder how ::Ellipse and ::ArcTo were implemented(or CDC::Ellipse, CDC::ArcTo in MFC library), I really wish I could have a chance to see the source code of those functions, or less than that, an idea how it was possible to draw an ellipse(not a circle) on the screen, by being given a mere boundary rectangle. I guess there got to be a lot of plane geometry involved, hell, wouldn't it be terribly time consuming to calculate coordinates of every single point on the arc?

      D Offline
      D Offline
      Dominik Reichl
      wrote on last edited by
      #2

      It's not that hard :) Have a look at this: http://wscg.zcu.cz/wscg2001/Papers_2001/R18.pdf Best regards, Dominik


      _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;) (doesn't work on NT)

      1 Reply Last reply
      0
      • A Abin

        I just wonder how ::Ellipse and ::ArcTo were implemented(or CDC::Ellipse, CDC::ArcTo in MFC library), I really wish I could have a chance to see the source code of those functions, or less than that, an idea how it was possible to draw an ellipse(not a circle) on the screen, by being given a mere boundary rectangle. I guess there got to be a lot of plane geometry involved, hell, wouldn't it be terribly time consuming to calculate coordinates of every single point on the arc?

        F Offline
        F Offline
        f64
        wrote on last edited by
        #3

        Hi, For most of the devices, the GDI will just delegate the drawing to the device itself because the drawing has been optimized by the manufacturer of that piece of hardware. Check the API GetDeviceCaps, it tells you if the hardware device is capable to draw the primitive, in this case, of an ellipse. Fabian

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups