The Sandbox Thread

14 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

My first Avalon application: DesktopClock

Back to Forum: The Sandbox
  • User profile image
    Kazi

    Just playing with the new WinFX SDK, and the result is my first Avalon application, a desktop clock. Contains simple scalable vector graphics.

    Built with VS2005 beta 2 and WinFX SDK beta 1 RC.

    Sources and binaries are included. A good (but simple) demo for the transformation features of Avalon.

    EDIT1:

    Context menu added, right click to reach it. You can choose a smoother, nicer animation-like update method, but that consumes more processor cycles.

    EDIT2:

    System requiremnts to run this application:

    1. .NET Framework Version 2.0 Redistributable Package Beta 2 (x86) (minimum version: 2.0.50215.44)
    http://www.microsoft.com/downloads/details.aspx?FamilyId=7ABD8C8F-287E-4C7E-9A4A-A4ECFF40FC8E

    2. Microsoft® Pre-Release Software Code Named "Avalon" and "Indigo" Beta1 RC runtime (minimum version: 2.0.50215.28)
    http://www.microsoft.com/downloads/details.aspx?familyid=B789BC8D-4F25-4823-B6AA-C5EDF432D0C1

    System requiremnts to compile this application:

    1. Visual Studio 2005 Beta 2
    http://lab.msdn.microsoft.com/vs2005/get/

    2. WinFX SDK Beta 1 RC
    http://www.microsoft.com/downloads/details.aspx?familyid=B789BC8D-4F25-4823-B6AA-C5EDF432D0C1

  • User profile image
    andokai

    Good job!

  • User profile image
    Kazi

    Thanks. I wanted blurred shadows but there are no image effect classes, left out in this release.

  • User profile image
    Buzza

    Looks Great

  • User profile image
    karstenj

    Nice Work!

  • User profile image
    Tyler Brown

    Great work! What did you use to create the vector graphics? I've been looking for an image editor to create vector graphcis with.

  • User profile image
    Kazi

    If you look into the source code you may be surprised how simple this little application is. There’s nothing special. There are lines only and text for the numbers. The most interesting thing of this application is its simplicity. The scaling feature is about 5-6 lines of coding. The canvas has a scaling transformation and when its size changes the scale factor is updated.

    Avalon is a great developing platform. It would be nice to work with Avalon sooner. I can experience its strength while I developed this tiny application. I recommend learning it for everybody.

  • User profile image
    viliescu

    Very nice!
    One suggestion: you can use Viewbox element which automatically scales its content so you don't have to handle the scaling yourself.

    So the XAML code will look something like that:
    <Viewbox Stretch="Uniform">
        <Canvas x:Name="canvas">
    ...

  • User profile image
    Kazi

    viliescu wrote:
    Very nice!
    One suggestion: you can use Viewbox element which automatically scales its content so you don't have to handle the scaling yourself.

    So the XAML code will look something like that:
    <Viewbox Stretch="Uniform">
        <Canvas x:Name="canvas">
    ...



    Really! I learned a new thing. Thanks. I have updated it.

  • User profile image
    Loadsgood

    Could you post up the system requirements for this app? Preferably in an edit to the initial post. Thanks Smiley



    Doo de doo doo doo,
    Loadsgood.

  • User profile image
    androidi

    Cool Smiley


    I am not certain whether these problems are with Avalon or the app. But here goes:

    Build a release version and run it out of VS (just to be sure there's no/less debug code).

    Now open up task manager and the cpu usage graph. Now run the app and put the continous update mode.

    Watch CPU usage graph rise for a minute or so.

    You can try minimize the app and the cpu usage stays same.


  • User profile image
    Kazi

    It behaves the same here. Interesting. But I don't know the reason.

  • User profile image
    Kazi

    androidi wrote:

    Cool


    I am not certain whether these problems are with Avalon or the app. But here goes:

    Build a release version and run it out of VS (just to be sure there's no/less debug code).

    Now open up task manager and the cpu usage graph. Now run the app and put the continous update mode.

    Watch CPU usage graph rise for a minute or so.

    You can try minimize the app and the cpu usage stays same.




    I have created some performance session with not too big result:
    The System.Windows.Media.RotateTransform.set_Angle(float64) function takes longest within the UpdateClockHands function.

    I have inserted a line into the UpdateClockHands function which outputs the "n" TimeSpan variable values. UpdateClockHands called normally by 50 msecs as given to the DispatchTimer.Interval property.

    I'm not sure, it's a bug or not.

  • User profile image
    NeoTOM

    Something like this was in the 16-bit versions of NT, I believe?

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.