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. How to fill between two spline curves with two different colors in C#

How to fill between two spline curves with two different colors in C#

Scheduled Pinned Locked Moved C#
questioncsharpregextutorial
4 Posts 4 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.
  • U Offline
    U Offline
    User 13293914
    wrote on last edited by
    #1

    Hi, I want to fill between two spline curves with two different colors (Above one of the curves (Red), and below it (yellow)). And also i want the end user to be able fill the mentioned area with a selected pattern. how can i do that? i have used from ValueToPixelPosition but it is not a proper way or i can not do it inpecable. thanks in advance.

    L J R 3 Replies Last reply
    0
    • U User 13293914

      Hi, I want to fill between two spline curves with two different colors (Above one of the curves (Red), and below it (yellow)). And also i want the end user to be able fill the mentioned area with a selected pattern. how can i do that? i have used from ValueToPixelPosition but it is not a proper way or i can not do it inpecable. thanks in advance.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      How do you "fill a curve"? There are "strokes" and stroke thickness and color. There are "shapes" one can "fill". There are "brushes" that can paint a pattern (WPF). You need to identify some primitives to work with. A "pixel", in this case, is a little too primitive.

      "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal

      1 Reply Last reply
      0
      • U User 13293914

        Hi, I want to fill between two spline curves with two different colors (Above one of the curves (Red), and below it (yellow)). And also i want the end user to be able fill the mentioned area with a selected pattern. how can i do that? i have used from ValueToPixelPosition but it is not a proper way or i can not do it inpecable. thanks in advance.

        J Offline
        J Offline
        jschell
        wrote on last edited by
        #3

        You must collect information sufficient to define the spline. You must determine the intersection points if any. From here I will proceed with the assumption that there are two and only two intersecting points. You must then determine the 'area' represented by the intersection. The user can then point to an area Determine if the area is in the is within the intersection. The points and the curves define this. Then allow the user to pick a pattern and color. Then use the last two steps to fill in the area. You start at one end and color to the other. You will need to figure out how to chop the pattern when you reach the edge.

        1 Reply Last reply
        0
        • U User 13293914

          Hi, I want to fill between two spline curves with two different colors (Above one of the curves (Red), and below it (yellow)). And also i want the end user to be able fill the mentioned area with a selected pattern. how can i do that? i have used from ValueToPixelPosition but it is not a proper way or i can not do it inpecable. thanks in advance.

          R Offline
          R Offline
          RodStephens
          wrote on last edited by
          #4

          You should make polygons, closed curves, paths, or some other graphic object to represent the areas that you want to fill. Then you can use the Graphics object's FillXxx methods to fill the areas with whatever brushes you like. Exactly how you define the closed areas will depend on exactly what you want. If you post a sketch, that would help.

          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