Click here to Skip to main content
15,897,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How will I achieve a gradient start from border to center of a shape? A sample picture can be seen here.
Posted
Updated 14-Aug-12 7:36am
v2
Comments
Kenneth Haugland 12-Aug-12 11:57am    
I cnat see the pricture, link is broken
mudiras 14-Aug-12 13:39pm    
Sorry link provided earlier needed login. You can see image at http://picturepush.com/public/8974428.
[no name] 12-Aug-12 12:06pm    
You are probably talking about a radial gradient.
mudiras 14-Aug-12 13:43pm    
Radial gradient are circular in shape, but I wish to have a box of gradient so that fist color starts from all borders and another colors go to the center. As shown in image at http://picturepush.com/public/8974428.

1 solution

Here is the Microsoft documentation on gradient brushes:
http://msdn.microsoft.com/en-us/library/aa970904.aspx[^]

Just use 4 linear gradient brushes for each side in the rectangle...
 
Share this answer
 
v2
Comments
mudiras 16-Aug-12 13:46pm    
It is not possible to apply more than one gradient to fill.

I have tried it by making 4 triangles apply gradient and rotate 3 of then by 90, -90 and 180 degree. This will render nearly as per my requirement but I am unable to have round corners and re sizing of page/window disturbed placement of triangle.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900