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. Drawing an arrow

Drawing an arrow

Scheduled Pinned Locked Moved C / C++ / MFC
graphicshelpquestion
7 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.
  • K Offline
    K Offline
    kfaday
    wrote on last edited by
    #1

    Hi, I'm trying to draw an arrow in a DC. i have a line, consisting of the starting point(aa) and the ending point(bb). (CPoint variables) I do a Moveto (aa) and then a LineTo (bb). What i want to do, is like a triangle, the end of an arrow (or just two lines), but i haven't came up with ideas. The problem is that the line can be in any direction, not just horizontal or vertical. how could i do that with just aa and bb(the start and end of the line)?? thanks!!

    PJ ArendsP 1 Reply Last reply
    0
    • K kfaday

      Hi, I'm trying to draw an arrow in a DC. i have a line, consisting of the starting point(aa) and the ending point(bb). (CPoint variables) I do a Moveto (aa) and then a LineTo (bb). What i want to do, is like a triangle, the end of an arrow (or just two lines), but i haven't came up with ideas. The problem is that the line can be in any direction, not just horizontal or vertical. how could i do that with just aa and bb(the start and end of the line)?? thanks!!

      PJ ArendsP Offline
      PJ ArendsP Offline
      PJ Arends
      wrote on last edited by
      #2

      If you want to use GDI+ you can use the Pen::SetStartCap() and Pen::SetEndCap() functions to have GDI+ draw the arrow heads for you. AFAIK, with GDI you have calculate and draw the arrow heads yourself.


      [

      ](http://www.canucks.com)Sonork 100.11743 Chicken Little "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 Within you lies the power for good - Use it!

      Within you lies the power for good; Use it!

      K 1 Reply Last reply
      0
      • PJ ArendsP PJ Arends

        If you want to use GDI+ you can use the Pen::SetStartCap() and Pen::SetEndCap() functions to have GDI+ draw the arrow heads for you. AFAIK, with GDI you have calculate and draw the arrow heads yourself.


        [

        ](http://www.canucks.com)Sonork 100.11743 Chicken Little "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 Within you lies the power for good - Use it!

        K Offline
        K Offline
        kfaday
        wrote on last edited by
        #3

        I'm using visual c++ 6.0, can i use GDI+?

        P 1 Reply Last reply
        0
        • K kfaday

          I'm using visual c++ 6.0, can i use GDI+?

          P Offline
          P Offline
          palbano
          wrote on last edited by
          #4

          Searching is wonderful... http://www.codeproject.com/vcpp/gdiplus/vc6gdiplusmacro.asp[^]

          "No matter where you go, there your are." - Buckaroo Banzai

          -pete

          K 1 Reply Last reply
          0
          • P palbano

            Searching is wonderful... http://www.codeproject.com/vcpp/gdiplus/vc6gdiplusmacro.asp[^]

            "No matter where you go, there your are." - Buckaroo Banzai

            -pete

            K Offline
            K Offline
            kfaday
            wrote on last edited by
            #5

            thanks! i'm getting this error: fatal error C1083: Cannot open include file: 'gdiplus.h': No such file or directory should i download microsoft's latest sdk? sorry for the questions, i'm kind of a beginner in this

            P 1 Reply Last reply
            0
            • K kfaday

              thanks! i'm getting this error: fatal error C1083: Cannot open include file: 'gdiplus.h': No such file or directory should i download microsoft's latest sdk? sorry for the questions, i'm kind of a beginner in this

              P Offline
              P Offline
              palbano
              wrote on last edited by
              #6

              yes, which is explained in this article on codeproject http://www.codeproject.com/vcpp/gdiplus/startinggdiplus.asp[^] which you can find by doing a Google search. You will find that productivity in software development is directly related to your ability to search for, read and understand documentation, articles and examples... even the bad ones :-D

              "No matter where you go, there your are." - Buckaroo Banzai

              -pete

              K 1 Reply Last reply
              0
              • P palbano

                yes, which is explained in this article on codeproject http://www.codeproject.com/vcpp/gdiplus/startinggdiplus.asp[^] which you can find by doing a Google search. You will find that productivity in software development is directly related to your ability to search for, read and understand documentation, articles and examples... even the bad ones :-D

                "No matter where you go, there your are." - Buckaroo Banzai

                -pete

                K Offline
                K Offline
                kfaday
                wrote on last edited by
                #7

                thanks!

                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