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. Graphics
  4. drawing a double dash line

drawing a double dash line

Scheduled Pinned Locked Moved Graphics
graphicsquestioncsharpwinforms
3 Posts 3 Posters 2 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.
  • B Offline
    B Offline
    Berlus
    wrote on last edited by
    #1

    Hello, How can i draw double dash line in gdi+ (preferably in c# ?) It should look something like this -_-_-_-_-_ . thanks, berlus

    T E 2 Replies Last reply
    0
    • B Berlus

      Hello, How can i draw double dash line in gdi+ (preferably in c# ?) It should look something like this -_-_-_-_-_ . thanks, berlus

      T Offline
      T Offline
      Tim Craig
      wrote on last edited by
      #2

      I think you'll have to draw two lines each with the different style that are parallel to each other. You could build a class to encapsulate the details.

      You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.

      1 Reply Last reply
      0
      • B Berlus

        Hello, How can i draw double dash line in gdi+ (preferably in c# ?) It should look something like this -_-_-_-_-_ . thanks, berlus

        E Offline
        E Offline
        ely_bob
        wrote on last edited by
        #3

        When I did this, I used either a Line drawing algorith(draw by pixel), or draw by overlapping lines... for a double line:

        g.Drawline(new Pen(7, black),pA,pB);
        g.Drawline(new Pen(3, white),pA,pB);

        results in a double line if you want it to be dashed...

        g.Drawline(new Pen(7, black),pA,pB);
        g.Drawline(new Pen(7, white),pA,pB-1x);
        g.Drawline(new Pen(7, black),pA,pB-2x);
        g.Drawline(new Pen(7, white),pA,pB-3x);
        g.Drawline(new Pen(7, black),pA,pB-4x);
        //cover up the "middle part"
        g.Drawline(new Pen(3, white),pA,pB);

        --O.k. I know it isn't "Real Code" but that should give you the idea...

        I'd blame it on the Brain farts.. But lets be honest, it really is more like a Methane factory between my ears some days then it is anything else...

        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