.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Image or ImageButton rounded corners

Posted By:      Posted Date: August 26, 2010    Points: 0   Category :ASP.Net

Hiiiii Coders,

I just want to make corners of my asp.net image or imagebutton rounded. How can i do so?  

View Complete Post

More Related Resource Links

Having problem with drawing rounded corners with borders using RoundedCornersExtender control

Hi, I have created panel using below syntax <asp:Panel style="z-index:4;top:270px;left:270px;width:320px;height:200px;position:absolute;"  Enabled="True" CssClass="Panel" TabIndex="4" Visible="True" runat="server" ToolTip="" BackColor="" BorderStyle="NotSet" BorderWidth="0px">  <div style="clear:both"></div></asp:Panel> and added rounded corner extened control using <cc1:RoundedCornersExtender Corners="All" runat="server" TargetControlID="panel4" BorderColor="Black" Enabled="True" Radius="10"></cc1:RoundedCornersExtender>Issue: At run time   there is  a gap between border and corners. I am using doctype of this" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >"If i changed the doc type to below "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" ><html xmlns="http://www.w3.org/1999/xhtml" >" its working fine.Is there any solution for this with out changing the doc type?Advanced thanks for your help.Thanks,Charles  

Cannot develop the rounded corners for panel

Hello All, I m trying develop rounded corners for panel. I have gone through this post and did exactly as below:.modalPopup { background-color:transparent; padding:1em 6px; } .modalPopup2 { background-color:#ffffdd; width:270px; vertical-align :top; } .modalBackground { background-color:gray; filter:alpha(opacity=70); opacity:0.7; } Here is the aspx code: <form id="form1" runat="server"> <asp:ScriptManager runat="server" ID="ScriptmanagerTest"></asp:ScriptManager> <div> <asp:LinkButton ID="lnkButton" runat="server">Show Modal popup</asp:LinkButton> <br /> <asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" style="display:none;"> <asp:Panel ID="Panel2" runat="server" Width="334px" CssClass="modalPopup2"> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br /> <asp:Button ID="btnCancel" runat="server" Text="Cancel" /> <asp:Button ID="btnOK" runat="s

Loading UserControl doesnot render panel properly with rounded corners

Hello folks,I am doing the following steps of code to load a childusercontrol into a parent and load it as a popup.Please help me correct my code below as I am not able to get the rounded corners.Below is my aspx page:<%@ Register Src="~/MessageUC.ascx" TagName="MessageUC" TagPrefix="Ctrl" %> <head runat="server"> <title></title> <link href="Styles/PopUp.css" rel="stylesheet" type="text/css" /> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <Ctrl:MessageUC ID="MsgModal" runat="server" /> <asp:Button ID="btnFireOkMessage" runat="server" Text="Show" Height="44px" Width="225px" /> </form> </body> And here is aspx.vbProtected Sub btnFireOkMessage_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnFireOkMessage.Click Dim str As String = "Header" Dim strBody As String = "Body" MsgModal.Show(TestModalPopup.MessageUC.MessageType.Success, str, strBody, 200, 500) End Sub MessageUC.ascx<asp:LinkButton ID="LinkButtonTargetCon

Give image round corners

Hello, I would just like to know if anyone can give me some advice on how to take a jpeg image and make the corners rounded at runtime using gdi+ and aspnet. Thanks in advance Wesley

How to make background-image of table or panel Rounded ?

Hi, I have taken background-image of a Table and Panel, that image's corner is rectangula. How can i make its corners Rounded ? I searched some online resources, images were made rounded, how to make make background-image rounded on the fly ? 

Rounded Corners on Web Parts


Hi all

I am having some trouble adding rounded corners to my web parts.

I can add rounded corners to three of the corners on the web part chrome by editing the following CSS:

/* Top Left Corner */

.ms-WPHeaderTd {

	background: #04a204 url('/images/tl.gif') no-repeat left top;


/* Top Right Corner */

.ms-WPHeaderTdMenu {

	background: #04a204 url('/images/tr.gif') no-repeat right top;


/* Bottom Left Corner */

.s4-wpcell-plain {

	background: #04a204 url('/images/bl.gif') no-repeat left bottom;


It is the bottom that I am having problems with, I cannot find a way of adding an image to the bottom right corner. CSS3 would be able to do this, but support is thin and SharePoint 2010 doesn't seem to like it in IE9 anyway. I've also found very little online in relation to this problem.

Any help or suggestions would be greatly appreciated.

Many thanks


imagebutton shows "submit query" before image display


hi guys,

i have imagebutton's on a page with width/height's set and the imageurl pulls from a database

anyway theres 20'ish images on the same page so it takes a second or 2 for the images to load, unfortunately with the imagebutton, while it's in that limbo stage there's 20 big ugly grey SUBMIT QUERY textboxes in my face.


anyone know how to wkraround this? some sort of default already loaded image, or somehow to turn that off altogether? 

Where to find width of ImageButton after the image has been loaded?


I have an ImageButton that loads different images (of differening sizes) based on a selection made by the user from a dynamic data list. This ImageButton is displayed beside the DetailView. I want to get the width of the DetailView (which is static) and the width of the ImageButton so I can set the width of the Div they are contained in to the sum of their width, plus a few px. Once I set the width of the DIV and I set and margins (left and right) are auto, the DetailView and ImageButton will be centered in the page. However, every way I've tried to get the ImageButton width, it is always zero. I've trying coding the ImageButton Load event and its PreRender event but I get zero in both cases. Do I need to check some other property, or another event, like maybe one from the form itself?


How to make borders of a report item as rounded corners in rdlc?


Am designing a report using rdlc with report items such as rectangles and lists. I want to make those borders as rounded/blunted corners.....

Is there any possibilities to make it possible?



Thanks in advance.

Put a picture into a Graphic-object with rounded corners


Hi all

I foung an interesting code for drawing a rectangle with rounded corners on a windows form.


Now I would like to "fill" the graphic with a picture. (A .jpg-image)

Let's say I would like to display:



Dim myImage As

Give image rounded corner not working


 I'm trying to pass an bitmap and get method to pass it back with rounded corners, any help why this is not working would be great, currently the image comes back with out any changes.


public class ImageHelper
    public static byte[] RoundCorners(Bitmap imgin, int roundedDia, Color BackgroundColor)
            Bitmap bitmap = new Bitmap(imgin.Width, imgin.Height);
            Graphics g = Graphics.FromImage(bitmap);
            g.SmoothingMode = 	(System.Drawing.Drawing2D.SmoothingMode.AntiAlias);
            Brush brush = new System.Drawing.TextureBrush(imgin);
            FillRoundedRectangle(g, new Rectangle(0, 0, imgin.Width, imgin.Height), roundedDia, brush);
            // done with drawing dispose graphics object.
            System.IO.MemoryStream ms = new System.IO.MemoryStream();
            imgin.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
            ms.Position = 0;
            byte[] data = new byte[ms.Length];
            byte[] Image1 = ms.ToArray();
            return Image1;

    public static void FillRoundedRectangle(Graphics g, Rectangle r, int d, Brush b)
    { System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath();
        gp.AddArc(r.X, r.Y, d, d, 180, 90);

Rounded Corners with Gradient Background?


I'm trying to combine rounded corners (using Ajax Control Toolkit) and a gradient background (using CSS) but I'm not having much luck combining the two.  Any help would be appreciated.  Thanks,

Here's my code:

    color: #fff;
    margin: 0; 
    border: 0; 
    padding: 0;
    width: 50px; 
    text-align: center;
    /* For WebKit (Safari, Google Chrome etc) */
    background: -webkit-gradient(linear, left top, left bottom, from(#969696), to(#000000)); 
    /* For Mozilla/Gecko (Firefox etc) */
    background: -moz-linear-gradient(top, #969696, #000000); 
    /* For Internet Explorer 5.5 - 7 */ 
    /* filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#FF0000FF, endColorstr=#FFFFFFFF); */ 
    /* For Internet Explorer 8 */
    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#969696, endColorstr=#000000)";


                <cc1:RoundedCornersExtender ID="rc1" runat="server" TargetControlID="rounded" Corners="Top">
                <div id="rounded" runat="server" style="background-color: #000000; margin: 0; border: 0;
                    padding: 0;">

Built-in Functions - Text and Image Functions in SQL Server

Text and image functions operate on TEXT, NTEXT and IMAGE data types. These data types are deprecated with SQL Server 2005 and should be replaced by VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) when possible. Alternatively you can also consider storing large string values using XML data type. Text and image functions are nondeterministic.

Future versions of SQL Server will not support TEXT, NTEXT and IMAGE data types. Columns with TEXT / NTEXT data type do not support commonly used string functions such as LEN, LEFT, RIGHT, etc. Furthermore, due to the large size of TEXT data you''re likely to see performance issues if you store such data in the database. However, at times you can''t help but use the TEXT / NTEXT / IMAGE data types (for example when supporting 3rd party databases when you cannot change the schema) - this is when text and image functions come in handy.

Program for Format Conversion of An Image

.NET provides extensive support for image conversion. Any image can be processed from one format to another. Most common formats to which .NET have support for are .BMP, .EMF, .GIF, .ICO, .JPG, .PNG, .TIF and .WMF.

Configuring Profile Image Export in SharePoint 2010

It's no secret that I am thrilled with the new social features of SharePoint 2010. I am most excited about the new Profile Picture handling. I strongly believe that the more we can show the faces of our colleagues to one another the more connected we will feel. Clearly Microsoft feels that way as witnessed by the many features that make use of the Profile Image like the Activity Feed and Colleagues list

Built-in Functions - Text and Image Functions

Text and image functions operate on TEXT, NTEXT and IMAGE data types. These data types are deprecated with SQL Server 2005 and should be replaced by VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) when possible. Alternatively you can also consider storing large string values using XML data type. Text and image functions are nondeterministic.

ASP.Net Upload Image to MS Access Database

As you learnt from the previous articles to upload image to the SQL Database in ASP.Net 2.0 and stream that image into the memory to retrieve it from the database and display it on the web page. In this article you will learn how to upload images to the MS Access database in ASP.Net 2.0

First of all create an Access Database and place it in the App_Data folder of ASP.Net web site project. Then create a table "tblImg" with the following fields:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend