Tag Archives: png

Draw a smiley face with WPF in C#

Often I need to use images for demonstration purposes or for a book, and a smiley face makes a neutral, pleasant image. This example shows how to draw a smiley face with XAML and WPF, and then save an image … Continue reading

Posted in drawing, graphics, image processing, wpf, XAML | Tagged , , , , , , , , , , , , , , | Leave a comment

Make a tool that creates PNG files with transparent backgrounds in C#

When you use the File menu’s Open command, the following code lets you select a image file. // The image. private Bitmap Bm = null; // Offset for displaying the image. private const int Offset = 10; // Open a … Continue reading

Posted in graphics, image processing | Tagged , , , , , , , , , , , , , | Leave a comment

Convert XPS files into PNG files in C#

This example lets you convert XPS files into PNG files. Note that it only seems to work with XPS (XMP Paper Specification) files and not OXPS (Open XMP Paper Specification) files. The example does three interesting things: convert XPS files … Continue reading

Posted in files, graphics, system | Tagged , , , , , , , , , , , , , | Leave a comment

Save WPF control images in C#

Occasionally I need to save WPF control images with transparent backgrounds for one reason or another. This time I needed to make some icons that displayed numbers. I could have used a Windows Forms application (it would have been a … Continue reading

Posted in drawing, files, graphics, wpf, XAML | Tagged , , , , , , , , , , , , | 1 Comment

Use WPF to make a download button in C#

This example uses WPF to make a download button similar to the one shown on the C# Helper web site’s blog posts. The following XAML code shows how the program builds the button. <Window x:Class=”howto_download_button.Window1″ xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” Title=”Window1″ Height=”107″ Width=”140″ … Continue reading

Posted in graphics, user interface, wpf, XAML | Tagged , , , , , , , , , , , , , , , | Leave a comment

Change image file types in a directory in C#

This program lets you save the images in a directory with new image file types. Enter a directory name and select a graphical file type: bmp, jpg, gif, png, etc. When you click Go, the proigram loads each of the … Continue reading

Posted in files, graphics | Tagged , , , , , , , , , , , , , , , , , , , | Leave a comment