|
-
Sep 19th, 2012, 07:52 AM
#1
New Member
Re: Shape Editor, including many shapes, Resize and more
How to add text on a shape ????
I've added this property to base class shape _
private string _Texto = String.Empty;
public string Texto
{
get { return _Texto; }
set
{
if (value.Trim() == String.Empty)
throw new ArgumentException("Texto cannot be empty.");
_Texto = value;
}
}
But i need to extend to (for example Rectangle )...how ??
Thanks for your great work !!
-
Sep 19th, 2012, 07:59 AM
#2
Re: Shape Editor, including many shapes, Resize and more
 Originally Posted by dtanh
hello @NickThissen!
can you help me about rotate rectangle in your code please!
Rotation of shapes is not supported. You could however create a new shape that has a Rotation property, and draw your rotated rectangle accordingly inside the current bounds. That would require a little trigonometry to figure out the locations of the four corners.
 Originally Posted by magefesa
How to add text on a shape ????
I've added this property to base class shape _
But i need to extend to (for example Rectangle )...how ??
Thanks for your great work !!
You could create your own class that inherits RectangleShape (or just Shape), add the Text property in that class (instead of the base class), and then override the Draw method and use Graphics.DrawString to draw the text.
-
Sep 19th, 2012, 09:26 PM
#3
New Member
Re: Shape Editor, including many shapes, Resize and more
 Originally Posted by NickThissen
Rotation of shapes is not supported. You could however create a new shape that has a Rotation property, and draw your rotated rectangle accordingly inside the current bounds. That would require a little trigonometry to figure out the locations of the four corners.
Thanks for your reply! i have been tried to rotate my rectangle, but not good. My rectangle is the current bound.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|