Is it possible to create realtime graphics in an ASP.NET page using GDI (E.G A clock)?

Posted on 2006-05-08
Last Modified: 2006-11-18

I'm not looking for code, more of a high level idea of where to start if it's possible.  I have created a control for a windows application that draws an analogue meter using GDI+.  It's just a jpg background that looks like a tachometer, and then I use GDI to draw the needle and update it every 300 milliseconds.

Is it possible to do the same sort of thing on an ASP.Net page?

Could I have an ASP page that has some kind of control embedded updates in realtime without the entire page needing to be refreshed?  I'm thinking of something like the Java applet analogue clocks that were so popular when Java first took off.


Question by:lambch0p
    LVL 17

    Expert Comment

    may be you can do it with an activeX control...
    LVL 24

    Accepted Solution

    You can do that if you use GDI to draw the entire image, but it would be a lot of out of band updates to keep a clock updated in Analog format.

    The only ways that I can think of is to draw like 15 seconds worth of images and cache them on the client by downloading them and using the javascript that is used to update the clock in digital format (many are available out on the web) and just change the graphics.

    Then at a 10 second interval use something like Ajax or the controls in Atlas ( to make calls to get the next set of graphics so that you do not incur timing issues in updating the clock.  

    I have built a Java applet one a long time ago and it was pretty configurable and stuff, but to do this type of active programming on a web page, is doable, but may be hoaky at best.

    But the answer is, you can do it.  The other thing you may be able to do is to put an image at an absolute position that is the "face" of the analog clock, and then have an image of the needles and with javascript move the needles to another absolute location and use an array to keep track of those in an array and just cycle through them with for(i=0;i<60;i++) and move the second hand needle, etc.


    Author Comment

    Thanks Ben,

    You've just convinced me that a Windows application is the way to go.


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now