Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gradient

Status
Not open for further replies.

MaxCurrent

Programmer
Jul 30, 2006
2
GB
OK, I have a rectangle but I want all of its edges to be a gradient merging the rectangle's fill and that of its surroundings. This effectivly means that I want the rectangle's lines to have a gradient fill. The radial gradient doesn't work because it won't go to the edges...

Anyone know of a way I can get the effect I need.

Thanks for your help,

Max
 
You can't give gradients to strokes I'm afraid. You would have to punch a small rectangle out of a larger rectangle to create a composite path that mimics the stroke, and give that path a gradient.

Not sure I can visualise what you are trying to achieve though, do you have an example?

 
Thanks but what I did was use a inner glow to get the effect. However, out of interest, how would you do what you describe above?
 
Create 2 rectangles, for example one is 200px x 200px and the other is 196px x 196px and align them both horizontally and vertically. Ensure the smaller is on top and then click Modify > Combine Paths > Punch. The resulting path is 2px wide, simulating a rectangles stroke, but unlike a stroke you can apply a gradient to it.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top