all groups > asp.net webcontrols > october 2005 >
You're in the

asp.net webcontrols

group:

Rounded corner button


Rounded corner button RahulH
10/31/2005 3:30:05 PM
asp.net webcontrols:
Hi,
I am a novice to System.Drawing namespace. I want to create a web custom
button control with rounded images.
I can create rounded corners, and image of text. but is there a way that i
can now join these images into a single image.
Thanks in advance,
Re: Rounded corner button Steve C. Orr [MVP, MCSD]
10/31/2005 3:48:46 PM
I suggest you look into this free control that can dynamically create
rounded buttons and other effects too:
http://SteveOrr.net/articles/BeautifulButtons.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


[quoted text, click to view]

RE: Rounded corner button Phillip Williams
11/2/2005 6:58:04 AM
Hi RahulH,

To get a corner button you might draw a polygon on the graphics object of
your bitmap as this:

//create a graphics object from the bitmap
Graphics g= Graphics.FromImage (bitmap);
//paint the background as specified by the user or else paint it as the
default
g.Clear (bgColor);
//add border to mark a button shape
Point[] poly = {new Point(10, 3), new Point(bitmapWidth-10, 3), new
Point(bitmapWidth-5, 5),
new Point(bitmapWidth-3, 10), new Point(bitmapWidth-3, bitmapHeight-10),
new Point(bitmapWidth-5, bitmapHeight-5), new Point(bitmapWidth-10,
bitmapHeight-3),
new Point(10, bitmapHeight-3), new Point(5, bitmapHeight-5),
new Point(3, bitmapHeight-10), new Point(3, 10),
new Point(5, 5), new Point(10, 3)};
g.FillPolygon (new SolidBrush (buttonBGColor), poly);

As for placing the text and the polygon on the same bitmap, you may review
demo#2 from my website: http://www.societopia.net/Samples/

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com


[quoted text, click to view]
AddThis Social Bookmark Button