Click here to Skip to main content
15,903,030 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
How to fill text(or)label with in a shape like circle(or)eclipse(or)polygon..................in C# Silverlight.

For example like http://www.sitepoint.com/create-type-within-a-shape-in-photoshop/[^]


Thanks in Advance...
Posted
Updated 8-Mar-12 17:57pm
v23

Adding text inside a rectangle would help you solve the problem.
Rectangle r = new Rectangle() { Height = 100, Width = 100 };
TextBlock tb = new TextBlock();


Apart from this, you can also look at things like http://silverlemma.blogspot.in/2009/03/creating-graphical-shapes-dynamically.html[^].
 
Share this answer
 
Comments
sivabond 24-Feb-12 5:55am    
Thanks for your reply....
I am tried it works well. But when i am adding text to a circle the part of the text is coming outside the shape ...
My requirment is need to fill the text with in the shape itself from top position coordinate...

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