Round corners control

Cool stuff presented by Scott Mitchell, a round corners web control. How many times I have to do some boxes like this !

He use GDI+ for the corners and generate dynamically a set of images. I also appreciate that he use the quantization article I mentioned earlier.

  • Download the complete code (in ZIP format)
  • View a live demo


    • Do you think that packing this stuff into HTML rather than putting where it belongs (CSS) is a good idea? And why on earth would you want to use server-side processing to generate something as constant as rounded corners? Seriously.

      This is a pretty interesting exercise as far as "gee-whiz" stuff goes, but I would definitely stay away from using this in production environment. If you need this control on your site/application, you may have much bigger problems than just rounded corners.

    • Hmm round corners in CSS. I don't think so. And the images are created only one time, so where is the problem ? No I found this is a great idea and a good example for a simple user control

    • Paschal,

      The biggest problem with this control is that, like many other ASP.NET controls, it mixes content and presentation into one inseparable, hard-coded mess. It should not be a prerogative of a developer to dictate the presentation of content. That's what designers are for.

      From the perspective of a Web developer, they should not care whether the logical area (or content placeholder if you will) that they create on the page has rounded corners or not -- the designer will provide the look and feel.

      Conversely, the designer should not care what all the logical areas are on the page. Their job is to make sure they look good and provide well-engineered UX.

      It is true, that for the smaller shops, developer and designer are often the same person. It doesn't mean, however, that they should think of their work as one monolithic experience.

      You don't mix your meat and veggies with your desert before consumption, and neither should you put styled HTML into your Web controls.

    • Scott,

      I don't think generation of images using .NET is a bad idea. There is nothing wrong with using whatever tools that are available to solve a problem.

      My dib is with the fact that something that should be emitted by an application as just a div is rolled into a monolithic control, where all of the rendering logic, including rendering of the corners, is hard-coded. Corners have nothing to do with functionality of your application and they have no business being in the application DLL.

      It's largely an issue of architecture, not the fact that one lacks graphic design skills.

      Let me pose the question this way -- do you think that changing the curvature or shape of your corners should involve recompiling the control and restarting Web application?

    Comments have been disabled for this content.