Rounded corner button

Discussion in 'ASP .Net Web Controls' started by RahulH, Oct 31, 2005.

  1. RahulH

    RahulH Guest

    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,
    RahulH
    RahulH, Oct 31, 2005
    #1
    1. Advertising

  2. 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


    "RahulH" <> wrote in message
    news:...
    > 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,
    > RahulH
    Steve C. Orr [MVP, MCSD], Oct 31, 2005
    #2
    1. Advertising

  3. 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


    "RahulH" wrote:

    > 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,
    > RahulH
    Phillip Williams, Nov 2, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Konrad

    rounded corners in data grid

    Konrad, Aug 30, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    817
    Ken Schaefer
    Aug 30, 2003
  2. Francisco J. Jurado

    Rounded corners in menu Table and Bottons

    Francisco J. Jurado, May 31, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    598
    John Timney \(Microsoft MVP\)
    May 31, 2004
  3. Jeremy Bowers
    Replies:
    3
    Views:
    424
    jrlen balane
    Mar 14, 2005
  4. Goruav
    Replies:
    0
    Views:
    310
    Goruav
    Jan 8, 2009
  5. MRe

    5x5 rounded-corner table

    MRe, Sep 30, 2009, in forum: HTML
    Replies:
    8
    Views:
    1,165
    Jan C. Faerber
    Oct 4, 2009
Loading...

Share This Page