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#
  4. I want to draw a empty triangular arrow

I want to draw a empty triangular arrow

Scheduled Pinned Locked Moved C#
tutorialquestion
4 Posts 2 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.
  • D Offline
    D Offline
    dreamwinter
    wrote on last edited by
    #1

    The triangular arrow like generalization description of the UML, I have think about it for some days,but I'm still have no any ways and means.Can you tell me how to draw it? If you can give some code to me,I'll be thankful to you for it.

    C 1 Reply Last reply
    0
    • D dreamwinter

      The triangular arrow like generalization description of the UML, I have think about it for some days,but I'm still have no any ways and means.Can you tell me how to draw it? If you can give some code to me,I'll be thankful to you for it.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      e.Graphics.DrawPath(Pens.Black, new System.Drawing.Drawing2D.GraphicsPath( new Point[] { new Point(20, 20), new Point(40, 40), new Point(0, 40), new Point(20, 20) }, new byte[] { (byte)System.Drawing.Drawing2D.PathPointType.Start, (byte)System.Drawing.Drawing2D.PathPointType.Line, (byte)System.Drawing.Drawing2D.PathPointType.Line, (byte)System.Drawing.Drawing2D.PathPointType.Line } )); Assuming that you're drawing it in your Paint handler. Christian Graus - Microsoft MVP - C++

      D 1 Reply Last reply
      0
      • C Christian Graus

        e.Graphics.DrawPath(Pens.Black, new System.Drawing.Drawing2D.GraphicsPath( new Point[] { new Point(20, 20), new Point(40, 40), new Point(0, 40), new Point(20, 20) }, new byte[] { (byte)System.Drawing.Drawing2D.PathPointType.Start, (byte)System.Drawing.Drawing2D.PathPointType.Line, (byte)System.Drawing.Drawing2D.PathPointType.Line, (byte)System.Drawing.Drawing2D.PathPointType.Line } )); Assuming that you're drawing it in your Paint handler. Christian Graus - Microsoft MVP - C++

        D Offline
        D Offline
        dreamwinter
        wrote on last edited by
        #3

        I guess that you must understand UML shapes,do you remenber the inher inherit shape? That has a line and a triangular? I want to draw the shape use with GDI+. I have write some code.But there are some error,Can you help me?:^) ----------------------------------- private void Form2_Paint(object sender, PaintEventArgs e) { e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; GraphicsPath capPath = new GraphicsPath(); Point[] cappoints = new Point[] { new Point(0, 0), new Point(10, 0), new Point(0, 10), new Point(0, 0) }; capPath.AddLines(cappoints); CustomLineCap myCap = new CustomLineCap(null, capPath); Pen capPen = new Pen(Brushes.Black, 1); capPen.CustomEndCap = myCap; capPen.CustomStartCap = myCap; myCap.StrokeJoin = LineJoin.Round; myCap.WidthScale = 2; e.Graphics.DrawLine(capPen, new Point(100, 100), new Point(300, 100)); ---------------------------------------------

        C 1 Reply Last reply
        0
        • D dreamwinter

          I guess that you must understand UML shapes,do you remenber the inher inherit shape? That has a line and a triangular? I want to draw the shape use with GDI+. I have write some code.But there are some error,Can you help me?:^) ----------------------------------- private void Form2_Paint(object sender, PaintEventArgs e) { e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; GraphicsPath capPath = new GraphicsPath(); Point[] cappoints = new Point[] { new Point(0, 0), new Point(10, 0), new Point(0, 10), new Point(0, 0) }; capPath.AddLines(cappoints); CustomLineCap myCap = new CustomLineCap(null, capPath); Pen capPen = new Pen(Brushes.Black, 1); capPen.CustomEndCap = myCap; capPen.CustomStartCap = myCap; myCap.StrokeJoin = LineJoin.Round; myCap.WidthScale = 2; e.Graphics.DrawLine(capPen, new Point(100, 100), new Point(300, 100)); ---------------------------------------------

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          I don't see any error, unless the shape being drawn is not what you want, in which case you just need to move the points until it is ? Christian Graus - Microsoft MVP - C++

          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