xcon - xaml converter

Index

Intro

xcon is a simple xaml to raster conversion tool. This command line application can convert to the following raster formats: bitmap, jpeg, gif, png, tiff and wmp.
Application is written in C# under VS2008 and requires
.NET Framwork 3.0 or later. Tested on WinXP only. Project is released under LGPL licence.

Download

xcon can be downloaded here (both, binary and source).
Unpack and run with arguments (see Usage).

Usage

Run xcon -help for explanation of the syntax. Usage: xcon [options] <source> <destination>

Options:
-help, -?           show this message
-v, -verbose        show messages during conversion process
-format=[value]     encode to the specified format:
                      bmp, jpg, gif, png, tiff or wmp
-dpi=[value]        resolution in dpi
-width=[value]      raster width
-height=[value]     raster height

Examples:
xcon -help
xcon -verbose -format=jpg c:\temp\test.xaml c:\temp\test.jpg

Xaml Rules

Root element in xaml must be Canvas with xmlns, width and height attributes.
Width and height attributes represent final image dimensions in pixels.
Xaml should be rendered as in WPF application (WPF xaml rules).

Samples

hello.xaml -> xcon -format=png hello.xaml -> hello.png (transparent background)
project.xaml -> xcon -format=jpg project.xaml -> project.jpg

Source Code

Add xcon as existing project to your solution tree. using PapnKukn.Conversion;
//...
Arguments arg = new Arguments();
Converter converter = new Converter(arg);
converter.XamlToJpeg(@"C:\temp\project.xaml", @"C:\temp\project.jpg");

Tutorial

(under construction)

Questions

Send me an e-mail if you have any question.