Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Brushed steel brush in WPF?

Tags:

c#

wpf

brush

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!

like image 812
Jens Avatar asked Aug 19 '10 06:08

Jens


2 Answers

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.

like image 106
Merlyn Morgan-Graham Avatar answered Nov 16 '22 04:11

Merlyn Morgan-Graham


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?

like image 1
Hendrik Wiese Avatar answered Nov 16 '22 05:11

Hendrik Wiese