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. Gradient background from image for XAML.

Gradient background from image for XAML.

Scheduled Pinned Locked Moved WPF
csharpwpfdesignquestion
5 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.
  • U Offline
    U Offline
    User 2322509
    wrote on last edited by
    #1

    Hi, Is there any way to find out gradient colors and stops from image? I have mockups of screen from my user experience guy. From those i want to find out gradient stops (points) and colors he used. currently I am using Paint.net and expressing blend and getting the colors creating them in XAML for the same. GradientStops are the biggest challenge. Thanks

    A P 2 Replies Last reply
    0
    • U User 2322509

      Hi, Is there any way to find out gradient colors and stops from image? I have mockups of screen from my user experience guy. From those i want to find out gradient stops (points) and colors he used. currently I am using Paint.net and expressing blend and getting the colors creating them in XAML for the same. GradientStops are the biggest challenge. Thanks

      A Offline
      A Offline
      AspDotNetDev
      wrote on last edited by
      #2

      I don't think there is any tool to infer gradient information from an image. This seems like it could get rather complicated. What you might be able to do is create a differential image. You can create an image where each pixel represents the maximum difference in color between that pixel and the pixels neighboring it in the source image. That way, you can have a visualization of the changes in color, rather than just a visual of the colors. That should help you identify exactly where changes to changes (i.e., gradient stops) occur in the image. You could go a step further and make another image that is a differential image of the differential image. This will allow you to see changes in changes in changes (that may be useful for visualizing polynomial gradients that change into different polynomial gradients). But you'd have to build that tool yourself (unless anybody knows of a tool that can do that). I'd say just eyeball it or have your user experience guy use Expression Blend so you can see the actual XAML that creates the image.

      [Forum Guidelines]

      U 1 Reply Last reply
      0
      • A AspDotNetDev

        I don't think there is any tool to infer gradient information from an image. This seems like it could get rather complicated. What you might be able to do is create a differential image. You can create an image where each pixel represents the maximum difference in color between that pixel and the pixels neighboring it in the source image. That way, you can have a visualization of the changes in color, rather than just a visual of the colors. That should help you identify exactly where changes to changes (i.e., gradient stops) occur in the image. You could go a step further and make another image that is a differential image of the differential image. This will allow you to see changes in changes in changes (that may be useful for visualizing polynomial gradients that change into different polynomial gradients). But you'd have to build that tool yourself (unless anybody knows of a tool that can do that). I'd say just eyeball it or have your user experience guy use Expression Blend so you can see the actual XAML that creates the image.

        [Forum Guidelines]

        U Offline
        U Offline
        User 2322509
        wrote on last edited by
        #3

        Thanks. Yes, using expression blend by user experience was one of the options we explored, but he is not that familiar with it and he is the only one in team and using EB is time consuming.

        1 Reply Last reply
        0
        • U User 2322509

          Hi, Is there any way to find out gradient colors and stops from image? I have mockups of screen from my user experience guy. From those i want to find out gradient stops (points) and colors he used. currently I am using Paint.net and expressing blend and getting the colors creating them in XAML for the same. GradientStops are the biggest challenge. Thanks

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          What tool is he using to mockup the screens? If he's using something like Photoshop, there is a XAML converter available - take a look here[^] for details.

          "WPF has many lovers. It's a veritable porn star!" - Josh Smith

          As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

          My blog | My articles | MoXAML PowerToys | Onyx

          U 1 Reply Last reply
          0
          • P Pete OHanlon

            What tool is he using to mockup the screens? If he's using something like Photoshop, there is a XAML converter available - take a look here[^] for details.

            "WPF has many lovers. It's a veritable porn star!" - Josh Smith

            As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

            My blog | My articles | MoXAML PowerToys | Onyx

            U Offline
            U Offline
            User 2322509
            wrote on last edited by
            #5

            Thanks for the suggestion and yes he is using Photoshop. I will try using the tool you pointed to.

            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