开发者

How to draw these shapes using .Net drawing

I want to draw the shapes on the link below:

http://www.sendspace.com/file/n1tx5t

Could anyone shed a light on this?

Please note the rounded corner of the shapes (polygon, arrow, etc. The colour of the shapes have to change dynamically), and it has to be used in web forms.

I tried transparent arrow with dynamic colour, but it did NOT work. Is it possible to draw a transparent image (*.png) on top of a Bitmap开发者_运维问答 with background colour. Therefore, the colour of arrow will change?


These shapes, aren't included by default in .NET, but assuming that you're either using WinForms or WPF you can easily show them by adding a picture box/ image control to your form and then selecting a picture of an arrow that you've created yourself/ or downloaded somewhere.

Here is a small tutorial about adding a picture box (for WinForms) http://www.startvbdotnet.com/controls/gbox.aspx )

And here is a small tutorial about the image control (for WPF) http://anuraj.wordpress.com/2008/05/17/displaying-image-in-wpf-image-control/


You can draw them using a paths in GDI+ or in WPF


Here are some tutorials I found that should get you started with rounded rectangles and gradient fills:

Gradient fills (ie. where the shading varies in color and/or density across the shape) are a standard feature:

http://msdn.microsoft.com/en-us/library/ms229655.aspx

And this guide includes a class for rounded rectangles (.NET 1):

http://www.codeproject.com/KB/GDI-plus/ExtendedGraphics.aspx

Although there are better ways of doing it in .NET 4:

http://msdn.microsoft.com/en-us/library/system.drawing.rectangle.round.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜