Category Archives: multimedia

Make a WPF button template in C#

The example Control a video with the WPF MediaElement in C# uses attractive button images, but those images still sit on top of rectangular buttons. The images were generated by the example Make video control buttons in WPF and C#. … Continue reading

Posted in controls, graphics, multimedia, wpf | Tagged , , , , , , , , , , , , , , , , , , , , | Leave a comment

Control a video with the WPF MediaElement in C#

This example shows how you can control an MP4 video with WPF’s MediaElement control. The control provides a surprisingly nice assortment of features that let you play, pause, position, and otherwise control a video. The following XAML code defines the … Continue reading

Posted in controls, graphics, multimedia, wpf | Tagged , , , , , , , , , , , , , , , , , , | 2 Comments

Animate the Tower of Hanoi problem in C#

This example is similar to the example Recursively solve the Tower of Hanoi problem in C# except it uses animation to show how the disks move from one peg to another. The following AnimateMovement method moves a disk in a … Continue reading

Posted in algorithms, animation, drawing, graphics, multimedia, recursion | Tagged , , , , , , , , , , , , , , , , | Leave a comment

Draw an animated atom in C#

When the form’s Timer fires, its Tick event handler refreshes the form to force a redraw. The form’s Paint event handler draws the atom. private double Theta = 0; private const double Dtheta = Math.PI / 5; // Draw the … Continue reading

Posted in animation, drawing, graphics, multimedia | Tagged , , , , , , , , , , , | Leave a comment

Perform Windows Forms property animation in C#

Making a control’s properties change over time is called property animation. Keeping track of where a control’s properties, for example its position as it moves, can be tricky, particularly if you need to animate multiple objects at the same time. … Continue reading

Posted in algorithms, classes, multimedia | Tagged , , , , , , , , , , , , | 4 Comments

Continuously graph stock prices in C#

The example Get stock prices from the internet in C# explains how to get stock prices from the Yahoo! finance web site. This example uses similar techniques to query the site periodically and then graph stock prices. This example is … Continue reading

Posted in algorithms, finance, graphics, internet, mathematics, multimedia, web | Tagged , , , , , , , , , , , , , , | Leave a comment

Change audio gain in C#

Note: This example was written in Visual Studio 2010. This example shows how you can re-encode a video to change its audio gain. Earlier examples such as Change video quality in C# show how to use Microsoft Expression Encoder to … Continue reading

Posted in animation, multimedia | Tagged , , , , , , , , , , , , , , , , , , , | Leave a comment

Merge splash screens and videos in a directory in C#

(Note that this example was written in Visual Studio 2010.) This example shows how you can merge splash screens and videos in a directory. The example Merge videos in C# shows how you can concatenate two videos. Because I had … Continue reading

Posted in animation, files, multimedia | Tagged , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Merge videos in C#

(Note that this example was written in Visual Studio 2010.) My original problem was that I had created a bunch of videos and needed to add a splash screen at the beginning of each. This example merges videos so it … Continue reading

Posted in animation, multimedia | Tagged , , , , , , , , , , , , , , , , , , | 10 Comments

Change video quality in C#

(Note that this example was written in Visual Studio 2010.) This post shows how you can load and save a video with a given video quality. Lately I’ve been recording screencast videos for my next book. Unfortunately I recorded several … Continue reading

Posted in animation, API, multimedia | Tagged , , , , , , , , , , , , , , , , , , | 2 Comments