gwycon.com
Silverlight, WPF and C# .NET development
User NamePassword

25
Feb
« Updated Post »

See link at the bottom of the post for information on how to download Microsoft Visual Studio 2010, or just go straight to the Microsoft Visual Studio site here.

The next major release of Microsoft’s Visual Studio development environment is apparently going to be developed with the front end GUI written in WPF (Windows Presentation Foundation). Much of Visual Studio will still probably be written in C++, there will be significant portions of it developed with C# and WPF. WPF as many of you may know is the new Windows Forms API that is set to supersede the current version that has been around since the .NET 1.0 framework was released. Although there are other existing fully fledged applications developed in WPF, one of which is Microsoft’s Expression Blend 2, Visual Studio 2010 is certainly going to be the largest application that makes use of the new WPF technology. WPF has attracted a lot of attention over the last year or so as it is based on a completely different structure to the more traditional Windows forms. Here is a run down of just a few of the features available to WPF developers:

  • 2D and 3D support baked directly into WPF.
  • New and more flexible structure for handling events (via ‘Routed Events’).
  • All Form elements are vector based and so resize to the parent container without loss of quality.
  • Many new layout controls for a much more flexible UI. Things like fluid layouts (similar to web applications) can be developed very easily).
  • Separation of the UI design from the code behind. The UI is designed using a new language called XAML (pronounced ‘zammel’).

This means that you will have some cool IDE tools available in Visual Studio 2010 such as being able to resize the code window (zooming in and out) rather than having to select a specific pixel size for your fonts. continue

Category : WPF | Blog
15
Jan

Here is an implementation of a trigonometric function, plotted as a 2D graph. Interactive controls are available to alter the graph dynamically. The sine wave plotted incorporates parameters commonly used in physics. You can directly control the amplitude (A), phase (phi), and the angular frequency (k).

Try it now! Click on the slider bars in the Flash example above to change the sine waves properties.

There are also some basic graph options that can be set via check boxes, these can be toggled on/off. Finally, there is a useful function that is a good thing to have in any application, and that is a reset button. This simply resets the graph back to the state when first loaded. This example is coded using ActionScript 2.0.

Extending this example to graph any function is fairly straight forward and could handle some quite complex equations with multiple parameters. The range of each axis would have to be carefully rendered though to make sure the graph ‘zoom’ was correctly set, otherwise the graph may not display correctly.

Category : ActionScript | Flash | Mathematics | Blog
10
Jan

In many graphics applications it is often necessary to know the distance between two points or pixels, such as collision detection in games. Here, we are just interested in calculating the distance between pixels in 2D. However, it is not that much more complicated to extend this to 3D and we will be covering this at a later date. Anyway, back to our 2D example.

We can determine the distance from one known pixel co-ordinate to another using some simple trigonometry. In the figure below we would like to calculate the distance from point a to point b. These could be any two pixels on the screen with co-ordinates (x1,y1) and (x2,y2) respectively.

The distance from a to b is calculated using Pythagoras’ theorem, as long as the co-ordinates of the two points are known. First we need to know the vertical difference between the points (y2-y1) and the horizontal difference (x2-x1) as show below. continue

Category : Graphics | Mathematics | Blog