Frank Hileman's WebLog

Vector Graphics with and Visual Studio Integration 2.7 Released

Vector Graphics Calculator

Download the translucent calculator executable.

Version 2.7 of the vector graphics system is released. The Translucent Calculator article describes how to build a user interface completely defined with vector graphics, using the new TranslucentForm class.

The calculator has no window border, and the edges are anti-aliased with per-pixel translucency, as seen in the close-up below:

Close-Up of Translucent Calculator

Grab any of the calculator corners to resize it using the mouse. Because this calculator is built with vector graphics, you can resize it without any of the pixel scaling problems inherent in bitmap graphics:

Smooth Resizing with Vector Graphics

The techniques in the article are ideal for applications that use skinning and fancy user interface features, such as gel buttons. The article describes how to separate a user interface from application logic, so you can build a custom calculator skin.

Other new features in this release include:

  • Greatly improved performance, in memory and time, for path gradient fills, by sharing gradient cache data across similar Elements
  • Other performance improvements for non-shared path gradient fills
  • Use the new BaseStyle property in Style to collect common appearance properties from several Styles into a single location
  • All mouse events in the Picture class now bubble up to Canvas or TranslucentForm, which have a set of new events, including PictureMouseDown
  • You can now drag and drop a Picture from the Toolbox onto a Canvas or TranslucentForm to display in the recipient
  • Use new ElementPoint property in ElementMouseEventArgs to determine the mouse position in the coordinate space of the Element raising the event

For a complete list of changes see the version 2.7 Readme document.

Published Thursday, September 15, 2005 7:51 AM by Frank Hileman


# re: 2.7 Released@ Thursday, September 15, 2005 11:21 AM

This is so wonderful... a nice example of a good look. Thanks.

# re: 2.7 Released@ Friday, September 16, 2005 4:33 PM


The calculator looks good, but does not work from the keyboard. Nice looking beautiful and useless tool. :-(

Is it easy (possible) to link the "gel" buttons to the keyboard keys?

by tarpan

# re: 2.7 Released@ Friday, September 16, 2005 4:44 PM

Hi Tarpan,

I did not have time to add that. It is easy to add. The CalculatorBrain should probably hook itself to the keyboard events in the TranslucentForm. Maybe I can add that soon.

# re: 2.7 Released@ Monday, September 19, 2005 2:04 PM

Hi Frank, looks very nice!

Does it work on Windows XP only, or also on 2000 and/or Windows 98?

Thank you!

by Mark

# re: 2.7 Released@ Monday, September 19, 2005 2:27 PM

Hello Mark, works everywhere .NET 1.1 runs. The TranslucentForm works on windows 2000 and up (XP).

For Windows 98, you cannot use TranslucentForm (the win32 API is not there) but you can set the Region property on a Form containing a Canvas. The Region can be set to the area occupied by a Shape in your Picture, by getting a GraphicsPath from the Shape, then getting a Region from that. I can send you sample code if you need it.


# re: 2.7 Released@ Wednesday, September 21, 2005 10:28 AM

The sample i dont need, but thanks for the info!

by Mark

# re: 2.7 Released@ Wednesday, October 5, 2005 8:20 PM

Wow Frank - this stuff is looking great! Fantastic work!

# re: 2.7 Released@ Thursday, October 6, 2005 9:28 AM

Thanks Shawn! Your comments are especially appreciated.