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. WPF
  4. Scaling Polyline w/o scaling thickness

Scaling Polyline w/o scaling thickness

Scheduled Pinned Locked Moved WPF
comquestion
5 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.
  • N Offline
    N Offline
    Niklas L
    wrote on last edited by
    #1

    Hello I'm scaling some Polylines, and for some I want the thickness of the line to follow the scale, works fine by default, but for some I want to keep a fixed pixel width regardless of scale. Is that possible in some simple way or do I have to calculate the StrokeThickness myself? thanks in advance Niklas

    home

    M 1 Reply Last reply
    0
    • N Niklas L

      Hello I'm scaling some Polylines, and for some I want the thickness of the line to follow the scale, works fine by default, but for some I want to keep a fixed pixel width regardless of scale. Is that possible in some simple way or do I have to calculate the StrokeThickness myself? thanks in advance Niklas

      home

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Niklas Lindquist wrote:

      I'm scaling some Polylines

      How are you currently doing this?

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      N 1 Reply Last reply
      0
      • M Mark Salsbery

        Niklas Lindquist wrote:

        I'm scaling some Polylines

        How are you currently doing this?

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        N Offline
        N Offline
        Niklas L
        wrote on last edited by
        #3

        Oh, sorry, I'm setting a TransformGroup containing a ScaleTransform and a TranslateTransform, on the Polylines RenderTransform property. I managed to recalculate the width, but it adds a lot of overhead in adding a number of event handlers. So I'm still interested in a simpler way to do this. /Niklas

        home

        M 1 Reply Last reply
        0
        • N Niklas L

          Oh, sorry, I'm setting a TransformGroup containing a ScaleTransform and a TranslateTransform, on the Polylines RenderTransform property. I managed to recalculate the width, but it adds a lot of overhead in adding a number of event handlers. So I'm still interested in a simpler way to do this. /Niklas

          home

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          Niklas Lindquist wrote:

          I'm still interested in a simpler way to do this

          I don't know of a simpler way. My guess is that you'd need to scale/translate the polyline points separately and create a new PolyLine from those points if you want to prevent the strokethickness from getting transformed.

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          N 1 Reply Last reply
          0
          • M Mark Salsbery

            Niklas Lindquist wrote:

            I'm still interested in a simpler way to do this

            I don't know of a simpler way. My guess is that you'd need to scale/translate the polyline points separately and create a new PolyLine from those points if you want to prevent the strokethickness from getting transformed.

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            N Offline
            N Offline
            Niklas L
            wrote on last edited by
            #5

            That's just as bad as recalculating the width I'd guess (if not worse, performance wise). Thanks for taking the time. /Niklas

            home

            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