locked
Can a solid-colour overlay be used against an element displaying a shape? RRS feed

  • Question

  • The subject is more confusing than it really is... basically, I have a solid colour (black) recycle icon in a resource dictionary as part of my art library.

    Now I'm making a button with the recycle icon... only, I want to 'normal' state to be blue, and the 'over' state be green.  I started making three different versions of drawing brushes in my art library, but thought there might be a better way so I don't have an over-bloated art library.

    Is there way to put an opaque overlay of colour on a displayed drawing brush?


    Purkiss

    Saturday, April 7, 2012 8:07 PM

All replies

  • So not sure I'm understanding correctly. Are you creating a new button template? Are you just embedding your icon on a button like <button><image></button>? Are these other colors things you will want to apply to for example, other buttons? Is your shape a xaml path?

    If the colors are going to be re-used in other controls, than yes you will want to create your brush resource(s) in your resource dictionary so they can be called to other controls, but a couple additional brush resources certainly shouldn't instill any fear of "over-bloating" something. Then you could just apply brushes as a static resource to the Fill property of your xaml paths (provided your recycle icon is a path.)

    Otherwise you could just take a copy of a default button control template, edit it to suit your needs, define your states/colors there and save it as a resource.

    However with the way it's worded, I may not be understanding your question entirely. :/


    Please mark answers as helpful when used, and answered when completed.

    Monday, April 9, 2012 4:07 PM