I am looking for ideas to create a WPF Brush with a brushed steel look, similar to the MacOSX Panther style, preferably without resorting to an ImageBrush. Is there a funky way to use a GradientBrush to create this effect?
Thanks in advance!
I am looking for ideas to create a WPF Brush with a brushed steel look, similar to the MacOSX Panther style, preferably without resorting to an ImageBrush. Is there a funky way to use a GradientBrush to create this effect?
Thanks in advance!
You could use a rotated LinearGradientBrush with many GradientStops in different grey tones. Well, it's at least an approach. For it to be scalable you would somehow need to make the GradientStops just one pixel wide which probably requires giving the size of the filled object to the brush, I guess. Might become a difficult task, but that's the fate of a real hacker, isn't it?
I don't know how to do this easily with programmatic brushes, but when I have used Photoshop to create a brushed steel effect, I essentially created noise, then smeared (blurred) it in the direction of the brushing:
http://www.adamdorman.com/tutorials/brushed_steel_tutorial.php
As someone mentioned in comments, you may want to do this, and create some sort of (repeating?) image brush. If you want your brushed steel effect to be programmatically generated, you could write a mean filter to do the blur for you. Generating noise is simple enough :)
An example of implementing a mean filter:
http://homepages.inf.ed.ac.uk/rbf/HIPR2/mean.htm
Modify this to have a Nx1 matrix, or have small (zero) for weights not on the current line, and you will have a horizontal blur.