Articles repository

Most articles on this page are spin-offs from, or inventories for, larger projects. They are put into a readable format and placed in this repository for general use.

All the code is in C#, often combined with markup in a Visual Studio project. Almost all articles come with free source code which can be downloaded. Most of it, however, is experimental. Do not use it in a commercial project directly. See the disclaimer at the bottom of this page.

Main categories:

WPF - Windows Presentation Foundation
WPF Graphics - Graphics based on XAML
WPF HowTo - How to do basic things in WPF
XBAP - XAML Browser Application
XPS - XML Paper Specification
SVG - Scalable Vector Graphics
XHTML - Extensible HyperText Markup Language
XML - Extensible Markup Language

Also on this page: DocBook, Encryption, RELAX NG, SSML.

Subjects do not always fit into a strict category when several techniques are combined. They are then placed in the most obvious section. Use the Find tool in your browser to find keywords.

For Silverlight see the the Silverlight - Articles section. For GDI+ see Digital Imaging.




NET Framework / Visual Studio

The .NET Framework is an integral Windows component that supports building and running applications and Web services. Visual Studio is a suite of component-based development tools and other technologies for building applications.

.NET Framework Versions and Dependencies.
Summarizes the .NET Framework versions and their dependencies.

Visual C# 2010 Express.
Installing and registering Visual C# 2010 Express.

Visual Web Developer 2010 Express.
Installing and registering Visual Web Developer 2010 Express.
Keywords | development environment | IDE | Silverlight | Windows Phone 7 | registration key | templates |

Using Visual Studio Express as XAML editor.
Visual Studio Express as an editor for loose XAML, with syntax highlighting and IntelliSense.

Installing XNA GameStudio 3.1.
XNA GameStudio 3.1 and extensions for media player Zune HD.

Microsoft Small Basic.
An introduction to the Small Basic development environment and Library.
Keywords | Small Basic | class library | XML Documentation | development environment | IDE | Import | Publish | Graduate | GraphicsWindow | Turtle | Console Application | Startup Object | deployment | XAP |

H3Viewer.
An alternative viewer for the Visual Studio 2010 MSDN Library documentation.





WPF

WPF (Windows Presentation Foundation), one of the components of .NET Framework versions 3.5 and 4.0, is for the creation of Windows applications.

WPF - Class Library.
The namespaces that contain Windows Presentation Foundation (WPF) APIs.
Keywords | WPF | Namespace | API |

WPF - Introductie.
Een introductie met een handleiding hoe een WPF project aangemaakt moet worden met uitleg bij alle onderdelen in zo'n project. Als demo wordt een 'Hello World' applicatie gemaakt (Visual Studio, XAML, C#).
Keywords | Application | StartupUri | code-behind | XAML |

Take a Break.
An easy to use timer reminds you to take a break.
Keywords | break-timer | interval-time | setup file | Resource |

Timer T1440.
A programmable 24 hour timer with a resolution of one minute.
Keywords | ListBox | ListBoxItem | sequencer | sorting | List<T> | break-timer |

De InkCanvas Control.
Een introductie bij het gebruik van de InkCanvas Control in WPF (Visual Studio, C#).
Tekeningen maken en tekst invoeren via tablet of muis en het bewaren van tekeningen als Ink Serialized Format (ISF).
Keywords | InkCanvas | Ink Serialized Format | ISF | Ink | DefaultDrawingAttributes | DrawingAttributes | Stroke | Strokes | StrokeCollection | StylusPoint | StylusPointCollection | EditingMode | Transform | Matrix |

Ink as Object, XAML and ISF.
The structure of Ink, saving parts as XAML and Ink Serialized Format (ISF).
Keywords | Digital ink | InkCanvas | InkPresenter | StickyNoteControl | Strokes | Stroke | StrokeCollection | Point | StylusPoints | StylusPointCollection | StylusPoint | DrawingAttributes | DefaultDrawingAttributes | FitToCurve | Bezier smoothing | Ink Serialized Format | ISF | XAML | XamlParseException | FileStream | MemoryStream | XamlWriter | XamlReader | Base64 | ToBase64String | FromBase64String | Matrix | Transform | Moiré pattern |

Ink to Bitmap converter.
Converting Ink from Ink Serialized Format (ISF) to Bitmap and Base64.
Keywords | Ink Serialized Format | ISF | Base64 | ToBase64String | FromBase64String | DrawingVisual | DrawingContext | PushTransform | TranslateTransform | DrawRectangle | RenderTargetBitmap | BitmapEncoder | StrokeCollection |

Ink to XAML conversion.
An experiment for converting drawings from the InkCanvas control to XAML.
Keywords | InkCanvas | Ink Serialized Format | ISF | StylusPoint | StylusPointCollection | Stroke | StrokeCollection | DrawingAttributes | FitToCurve | Path | Path mini-language | Base64 | PathFigure | PathGeometry | XamlWriter | XAML |

Text to Bitmap conversion.
Converting text to bitmap with the RenderTargetBitmap class.
Keywords | FrameworkElement | FormattedText | DrawingVisual | DrawingContext | RenderTargetBitmap | BitmapEncoder | PngBitmapEncoder | ImageSourceConverter | RichTextBox | FlowDocument | SetFontWeight | ImageBrush | Pbgra32 | BMP | GIF | JPG | PNG | TIF | WMP | dpi | XAML |

Bitmaps in code.
Storing icons and small bitmaps in code as Base64.
Discontinued - Replaced by 'Bitmap to Base64 conversion.'

Bitmap to Base64 conversion.
Converting a bitmap to Base64 for storage as text.
Keywords | Base64 | RFC 2045 | ToBase64String | FromBase64String | BitmapFrame | BitmapImage | Stream | MemoryStream |

A toolbar button in XPS Viewer style.
Making a toolbar button with a 'glow' border as used in the DocumentViewer class.
Keywords | XPS | DocumentViewer | Image | Rectangle | Print | Copy | Zoom | Page Layout |

The Frame Control as universal content navigator.
Navigating Objects, XAML and (X)HTML with the Frame Control.
Keywords | Frame | GoBack | GoForward | history | NavigationUIVisibility | JournalOwnership | XamlWriter | XAML | Page | Uri |

Scrolling loose XAML.
Showing large XAML images in a browser or in a Frame Control using the ScrollViewer.
Keywords | ScrollViewer | scroll bars | HorizontalScrollBarVisibility | VerticalScrollBarVisibility | XAML images | loose XAML | Frame |

Loose XAML as webpage.
Showing XAML directly in a browser as a webpage.
Keywords | Page | ShowsNavigationUI | title-bar | Hyperlink | NavigateUri | fragment navigation | http-equiv | KeepAlive | iframe | browser | Resources | ResourceDictionary |

Spelling Checker.
A lightweight spelling checker for use in a browser, as XAML.
Keywords | TextBox | RichTextBox | SpellCheck | spelling | red squiggly line |

Playing audio and video with the MediaElement.
A multi media player with a user interface as reusable class.
Keywords | MediaPlayer | MediaElement | audio | video | mp3 | au | mid | wav | wma | avi | wmv | Play | Pause | Resume | Stop | Volume | ScrollBar | Uri | Multimedia |

UniformGrid.
A simple version of Grid where all the cells have the same size.
Keywords | UniformGrid | UIElementCollection | RenderTargetBitmap | CroppedBitmap | Matrix | MatrixTransform | RenderTransform | Rotate | Translate | Border | grid-lines | XAML |

Implementing a GridSplitter in code and XAML.
How to create resizable compartments with the GridSplitter Control.
Keywords | GridSplitter | Grid | ColumnDefinition | RowDefinition | ResizeDirection | ResizeBehavior | GridResizeBehavior | SetRowSpan | SetColumnSpan | RowSpan | ColumnSpan | MinWidth | MinHeight | SpellCheck |

GridSplitter samples (XHTML page).
A collection of GridSplitter samples for use in WPF applications or Silverlight.
Keywords | GridSplitter | Grid | ColumnDefinition | MinWidth | RowDefinition | MinHeight |

GridSplitter samples (Silverlight).
A collection of GridSplitter samples for use in WPF applications or Silverlight.
Keywords | GridSplitter | Grid | ColumnDefinition | MinWidth | RowDefinition | MinHeight |

The Microsoft Surface domino tag.
A class for creating Microsoft Surface domino tags as XAML and Bitmap.
Keywords | Microsoft Surface | Domino tag | Ellipse | TransformGroup | ScaleTransform | LayoutTransform | Measure | Arrange | RenderTargetBitmap | PngBitmapEncoder | BitmapFrame | XamlWriter | XamlReader |

Highlighting words in a TextBox - Part 1.
A universal interface for decorating words in a TextBox or RichTextBox.
Keywords | Highlighting | yellow marker | browser | TextBox | RichTextBox | strike-through | squiggly line | ScrollViewer | ScrollChanged | ScrollToVerticalOffset | ScrollToHorizontalOffset | bounding rectangle | Rect | Union | GetRectFromCharacterIndex | FormattedText |

Highlighting words in a TextBox - Part 2.
Searching in a TextBox and highlighting the result.
Keywords | Highlighting | yellow marker | TextBox | ScrollViewer | yellow marker | search | bounding rectangle | Rect | Union | GetRectFromCharacterIndex |

2D Control arrays.
Using the Grid as a container for 2D arrays with Controls.
Keywords | Grid | array | RowDefinition | ColumnDefinition | SetRow | SetColumn | ShowGridLines | border | Margin | grid lines |

TextBlock Inlines.
TextBlock formatted text in code and XAML.
Keywords | TextBlock | Inlines | InlineCollection | Run | LineBreak | InlineUIContainer | Bold | Italic | Underline | Style | Setter | XAML | StaticResource | Image | Shape | XamlWriter | XamlReader |

ListBox - Sorting and moving items.
Basic sorting and arranging of items in a ListBox.
Keywords | ListBox | Items | ItemCollection | ComboBox | SelectionMode | SelectedItem | SelectedItems | SelectedIndex | SelectionMode | SelectionChanged | UnselectAll | sorting | SortDescriptions | SortDescription | ScrollIntoView | remove | select | insert | delete | rename |

ListBox - The ListBoxItem Class.
Adding custom items to the ListBox with the ListBoxItem class.
Keywords | ListBox | ListBoxItem | SelectionMode | Items | SelectedItem | SelectedItems | SelectedIndex | ItemCollection | SelectionChanged | GetItemAt | FindName | CheckBox | Uri | pack URI | moving items |

ListBox - Serializing and deserializing.
Conserving the contents of a ListBox by saving it to file as XAML.
Keywords | ListBox | ListBoxItem | XmlSerializer | XamlWriter | XamlReader | Items | ListBoxItem | ItemCollection |

How to make a sequencer with a ListBox.
Make a ListBox with editable text fields for executing tasks in a sequence.
Keywords | ListBox | ListBoxItem | Canvas | TextBox | sequencer | Timer | DispatcherTimer | BitmapImage | Uri | pack uri | UriKind | UriSource | FileStream | XamlWriter | XamlReader | Arduino |

A ListBox with data in XML.
Extending the ListBox with XML resource files.
Keywords | ListBoxItem | ItemCollection | meta data | List | XDocument | XElement | RELAX NG | schema | validation | hex color | SolidColorBrush | XML |

DIY list as an alternative for the ListBox.
An editable list made with the Grid and List<T> classes, serializable to XML.
Keywords | Grid | ColumnDefinitions | RowDefinitions | SetRow | SetColumn | list | List(T) | List<Label> | List<TextBox> | ListBox | XML | XmlRoot | XmlArray | XmlArrayItem | XmlSerializer | XMLRootAttribute | XmlArrayAttribute | StreamWriter | StreamReader | jagged array |

The TabControl.
Configuring a custom TabControl in code.
Keywords | TabControl | Selector | SelectedItem | SelectedIndex | SelectionChanged | Header | TabItem | BitmapFromResource | pack URI | Uri | BitmapImage | anti-aliasing |

Changing the pixel format for a WPF bitmap.
RGB, CMYK, indexed, gray scale and other pixel formats for BitmapSource.
Keywords | Image | BitmapImage | FormatConvertedBitmap | BitmapSource | BitmapFrame | BitmapEncoder | PixelFormat | palette | BitmapPalette | BitmapPalettes | Indexed | Gray Scale | Uri | List | color list | Bitmap |

WPF bitmap to System.Drawing.Bitmap.
An easy way for converting a WPF bitmap to System.Drawing.Bitmap.
Keywords | BitmapSource | BitmapImage | Uri | pack URI | BMP | GIF | JPG | PNG | TIF | WMP | BitmapEncoder | ImageFormat | MemoryStream |

The TIFF image format.
Storing multiple images and data in a TIFF file.
Keywords | TIFF | LZW | TiffCompressOption | TiffBitmapEncoder | TiffBitmapDecoder | BitmapSource | BitmapFrame | Frames | PixelFormats | Palette | BitmapPalette | CopyPixels | stride | color list | List | FormatConvertedBitmap | RNGCryptoServiceProvider | Stream | FileStream |

A TIFF file as data container.
Storing data in a TIFF file as byte arrays instead of images.
Keywords | TIFF | LZW | ZIP | TiffCompressOption | TiffBitmapEncoder | TiffBitmapDecoder | BitmapSource | BitmapFrame | Frames | PixelFormats | Palette | BitmapPalette | CopyPixels | stride | List | FormatConvertedBitmap | RNGCryptoServiceProvider | UTF8Encoding | Stream | FileStream |

Containers in XML.
General purpose containers in XML with Lists and Dictionaries.
Keywords | container | List | Dictionary | KeyValuePair | meta | XDocument | XElement | LINQ | XML | Base64 |

Data storage and visualization with the Polyline.
The Polyline shape as a container for byte array data.
Keywords | Polyline | Point | PointCollection | XamlWriter | XamlReader | FileStream | MemoryStream | LayoutTransform | ScaleTransform | cloning | scaling | disconnect | XamlParseException | UTF8Encoding | Base64 | RNGCryptoServiceProvider | Path mini-language |

WAV to MP3 converter.
Converting WAV audio files to MP3 with the LAME encoder.
Keywords | WAV | MP3 | WAV to MP3 | converter | LAME encoder | RareWares | Process | ProcessStartInfo | WaitForExit |

Encryption of Text.
Encryption of text and byte arrays with the RijndaelManaged class.
Keywords | encryption | decryption | RijndaelManaged | ICryptoTransform | CryptoStream | Key | password | Base64 | byte array |

Encryption of XML documents.
TripleDES encryption for XML documents or parts of it.
Keywords | encryption | decryption | TripleDES | TripleDESCryptoServiceProvider | Key | IV | hash | PasswordDeriveBytes | CypherMode | EncryptedXml | XmlDocument | XmlElement | XML | validation | EncryptedData | ID-attribute |

Validation of encrypted XML documents.
Implementation of the W3C 'XML Security RELAX NG Schemas' in C#.
Keywords | security | encryption | encrypted XML | EncryptedXml | schema | RELAX NG | Schematron | validator | well-formed | Mono | driver | EncryptedData | EncryptionMethod | CipherData | CipherValue | super-encryption | double encryption | Base64 | XML |

General purpose functions for encryption.
A toolbox with functions for encryption and password verification.
Keywords | encrypt | decrypt | AesManaged | SHA256Managed | text data | byte array | Base64 | hash | salt | password | Guid | RNGCryptoServiceProvider |

Splitting files.
Splitting a file to get smaller ones, or to store them distributed for security reasons.
Keywords | split | join | obfuscation | encryption | hash | SHA256Managed | dried banana chips |

Random numbers with the RNGCryptoServiceProvider.
Generating random numbers with values in a certain range.
Keywords | RNGCryptoServiceProvider class | Random class | range | cryptographic service provider | seed | uniform distribution |

GZip compression.
Compressing and decompressing files and byte arrays with GZip.
Keywords | compression | decompression | GZip | GZipStream | FileStream | MemoryStream | Base64 converter | Lorum Ipsum | RFC1952 | RFC1951 |

Saving application state as XML.
A class with a monostate pattern to make application state globally available.
Keywords | Monostate pattern | Singleton | state | static | field | attribute | XmlElementAttribute | XmlArrayAttribute | StreamWriter | StreamReader | XMLSerializer | escaping | XML |

Saving 2D arrays as XML with the XMLSerializer.
Using jagged arrays with the XMLSerializer to save two-dimensional arrays as XML.
Keywords | XmlSerializer | StreamWriter | StreamReader | Serializable | XmlRoot | XmlArray | XmlArrayItem | XmlIgnore | jagged array |

Conserving whitespace with the XMLSerializer.
How to implement the xml:space and xml:lang attributes with the XMLSerializer.
Keywords | XMLSerializer | xml:space | xml:lang | XmlAttributeAttribute | XmlAttribute | XmlElement | XML |





WPF - Graphics

Graphics with XAML, classes from the System.Windows.Media namespace (Shape, Geometry), and Bitmaps from the System.Windows.Media.Imaging namespaces.

WPF - X11 color names.
Predefined color names for WPF and Silverlight.

Custom color lists.
Creating reusable color lists with predefined and custom colors.
Keywords | Colors class | Color Structure | color list | predefined colors | StackPanel | Dictionary | Uri | XAML |

Color Dialog (WPF).
A color dialog with predefined WPF colors and custom colors from ARGB.
Keywords | ColorDialog | ShowDialog | predefined color | Brushes | Colors | ARGB | hexadecimal | resource file | List<Color> | ListBox | RepeatButton | XmlDocument | XML |

Vector and Point.
An overview of the Vector Structure and how to use vectors in graphics.
Keywords | Vector Structure | Matrix Structure | Multiply | Negate | Subtract | AngleBetween | Parse | Equals | Point | PointCollection | Transformation | Rotate | Invert | Scale | Translate | Math | Flip | Polygon | Polyline | Random | RNGCryptoServiceProvider |

Vector and Rect.
Sizing and moving rectangles with the Rect and Vector Structures.
Keywords | Vector | Rect | Pen | DrawingGroup | DrawingContext | DrawingVisual | DrawRoundedRectangle | DrawEllipse | Matrix | RenderTargetBitmap |

Vector Operators and Type conversions.
Vector operators and methods compared, explained with code snippets and diagrams.
Keywords | Vector | operator | type conversion | Addition | UnaryNegation | Subtraction | Multiply | Division | Equality | Inequality | Point | Size | Rect | Matrix |

Regular Polygons.
Drawing a regular polygon with any number of sides.
Keywords | Polygon | pentagon | hexagon | Vector | Matrix | MatrixTransform | TranslateTransform | RenderTransform | Honeycomb pattern | FrameworkElement | Point | Points | XAML | PNG |

Spirograph patterns.
Spirograph patterns constructed from rotating vectors.
Keywords | Spirograph | Harmonograph | Vector | Matrix | Polygon | PointCollection | PNG | XAML |

XAML Shapes (WPF).
An overview of the Shape classes and how to apply transformations to them.

Drawing with the Polyline class.
Drawing graphics from code with the Polyline class.

Scaling XAML graphics.
Functions for scaling, rotating and flipping XAML images.

How to transform objects with MatrixTransform.
Transforming objects in 2D space with the MatrixTransform class and the Matrix structure.
Keywords | Transformation | RotateTransform | ScaleTransform | SkewTransform | TranslateTransform | MatrixTransform | TransformGroup | Matrix | RNGCryptoServiceProvider | cloning | translate | rotate | scale | skew | flip | RenderTransform | LayoutTransform | Invert | SetIdentity | XAML |

The BlurEffect and DropShadowEffect classes.
Blurring and shadows for fuzzy elements in graphics.

A minimalist Turtle class in C#.
An alternative for the Small Basic Turtle class with functions for saving drawings as XAML or Bitmap.

Closed smooth curves - Part 1.
Drawing closed smooth curves with the PolyQuadraticBezierSegment class.
Keywords | Bezier | PolyBezierSegment | PolyQuadraticBezierSegment | Path | PathGeometry | Ellipse | PointCollection | RNGCryptoServiceProvider | random | XAML | PNG |

Closed smooth curves - Part 2.
Random closed curves with the PolyQuadraticBezierSegment class.
Keywords | Bezier | PolyQuadraticBezierSegment | Path | Path mini-language | Point | PointCollection | Resources | meta data | RNG | RNGCryptoServiceProvider | XAML | PNG |

Spirals.
How to construct 2D spirals with the PolyBezierSegment class.
Keywords | 2D Spiral | Bezier segment | PolyBezierSegment | PolyQuadraticBezierSegment | Path | PathGeometry | PointCollection | control-point | end-point | Circle | ScaleTransform | RotateTransform | TranslateTransform | SkewTransform | TransformGroup | XAML | PNG |

Spider web Pattern.
A spider web pattern with shapes and geometries.
Keywords | Spider web | pattern | spiral | LineGeometry | GeometryGroup | Path | Polyline | PointCollection | hit-test | Pen | RNGCryptoServiceProvider | XAML | PNG |

Graphene pattern.
A configurable Graphene pattern for illustrations.
Keywords | Graphene | carbon ring | hexagon | buckeyball | nano tube | Polygon | Ellipse | GradientBrush | MatrixTransform | RenderTargetBitmap | PngBitmapEncoder | XamlWriter | XamlReader |

LED patterns.
Designing LED patterns for lamps.
Keywords | LED | LED patterns | LED panel | Excellon drill file | G-code | CNC machine | List<Point> | XML

Braille patterns.
A class for Braille 6-dot patterns in code and XAML.
Keywords | Louis Braille | ASCII | Marburg Medium | Dictionary | pattern | binary string | XamlWriter | XAML | PNG | BRF | Braille Ready File |

Yi Jing symbols.
Yi Jing trigrams and hexagrams in code and XAML.
Keywords | Yi Jing | I Ching | Unicode | trigram | hexagram | abstract class | binary string | List | IList | Grid | XamlWriter | XamlReader | XAML | PNG |

Random shapes.
Visualizing random data with shapes from the System.Windows.Shapes namespace.

Artificial Signatures.
Creating artificial signatures with cubic Bezier curves and saving them as XAML or Bitmap.

Random Walk.
Generating random walk graphs and saving them as XAML and PNG.
Keywords | Brownian motion | random walk | RNGCryptoServiceProvider | Polyline | Turtle | meta data | ResourceDictionary | Resources | XamlWriter | XamlReader | XAML | PNG |

Cellular automaton.
A viewer for cellular automaton rules 0-255.
Keywords | Cellular Automaton | Game of Life | Rule | Stephen Wolfram | decimal to binary | Grid | RenderTargetBitmap | PngBitmapEncoder | PNG |

Game of Life.
Cellular automaton 'Game of Life' from John Horton Conway.
Keywords | Game of Life | Conway | cellular automaton | Grid | grid lines | flat button | RNGCryptoServiceProvider | DispatcherTimer | ScrollBar | Equals | XamlWriter | XamlReader | XAML |

XAML meta data as ResourceDictionary.
Adding meta data to serialized XAML as ResourceDictionary.
Keywords | meta data | Key Value | ResourceDictionary | DictionaryEntry | Resources | Dictionary | FrameworkElement | XamlReader | XamlWriter | XAML |

XAML meta data as UIElements.
Adding meta data to serialized XAML as UIElements.
Keywords | meta data | Key-Value pair | StackPanel | TextBlock | FindName | XamlReader | XamlWriter | XAML |

XAML to Bitmap converter.
Converting XAML elements to Bitmap, choose a resolution and save as PNG.

Graphics and user interfaces as Object or XAML.
Converting XAML to and from Object, functions for cloning and serializing XAML.

Photo test pattern.
Testing photos from an online print shop with a standard test pattern.

Zelf ansichtkaarten ontwerpen.
Ontwerpen van ansichtkaarten en online bestellen bij de AH fotoservice.

Transparent PNGs.
How to make transparent PNGs with Paint.NET as a replacement for GIF in webpages.
Keywords | PNG | GIF | transparent | alpha | alpha-channel |

Icon collections.
An icon collection in PNG format, size 16x16 px.
Keywords | PNG | unordered list | list-style-image |

Image cut outs.
Quickly cut out fixed size parts from an image.
Discontinued - Replaced by 'Shredding Images' and 'Square 'Instagram' Images'.

Shredding Images.
Simulated shredding and unshredding of images with CroppedBitmap.
Keywords | shredding | unshredding | shredder | CroppedBitmap | BitmapSource | BitmapFrame | BitmapImage | RenderTargetBitmap | TransformedBitmap | RotateTransform | Int32Rect | DrawingVisual | DrawingContext | Stream | MemoryStream | FileStream | Uri | PointCollection | ArgumentException | Random | RNGCryptoServiceProvider | BitmapEncoder | Image | JPG | PNG | XML | DARPA |

Square 'Instagram' Images.
Cropping existing images into a square format.
Keywords | Instagram | square | cropping | clipping | border | mouse cursor | Rect | Int32Rect | Rectangle | rounded rectangle | Pen | CroppedBitmap | ScrollViewer | scrollbar offset | DrawingVisual | DrawingContext | RenderTargetBitmap | FormatConvertedBitmap | Measure | Arrange | BitmapEncoder | PixelFormat | Filter | Gray Scale |

Grayscale conversions.
Converting color-images to grayscale with a selectable number of bits-per-pixel.
Keywords | Gray Scale | black-and-white | pixel format | PixelFormat | PixelFormats | BitmapImage | BitmapSource | FormatConvertedBitmap | RenderTargetBitmap | Matrix | MatrixTransform | Rectangle | Opacity | FrameworkElement | ScrollViewer | ComboBox | Image | BitmapEncoder | BitmapFrame | Mesaure | Arrange | pixelWidth | Pbgra32 | Gray16 | dpi | Filestream | XamlReader | XamlWriter | Object | PNG | JPG | XAML | Tide | Wisk |





WPF - HowTo

Short articles how to do basic things in WPF.
Before implementing features in an application it is often useful to test basic things in a small separate project. The projects below are examples of this.

How to add an icon to a Window.
Code snippets for working with icons in WPF.

How to make a Window with a custom border.
Replacing the standard Window border with a differently shaped alternative.

How to host a Windows Forms Control in WPF.
Get access to calendar dates in WPF with the Windows Forms MonthCalendar.

How to make a squiggly line.
A custom squiggly line for marking words in a text.

How to work with binary numbers.
Decimal to binary and binary to decimal conversion.
Keywords | Converter | Decimal | Binary | Yi Jing | LSB | MSB | LED Matrix | Arduino |

About Tuples.
A tuple is a data structure that has a specific number and sequence of elements.
Keywords | Tuple | Create | Item | TRest | Nesting | List | Index converter |

How to generate random bytes.
Generating random bytes in a certain range for testing purposes.
Keywords | RNGCryptoServiceProvider | Random |

About random text.
How to create random text, examples for applications.
Keywords | Random | RNGCryptoServiceProvider | RNG | dummy text | password | license key | binary number | hexadecimal number | hex color | GUID |

About GUID's.
How to generate a GUID from code.
Keywords | GUID | UUID | Equals | Assembly ID | RSS | DataMatrix |

About hashes.
How to create a cryptographic hash for a text or a file.
Keywords | Hash | MD5 | SHA256Managed | Base64 | hexadecimal |

About SolidColorBrush.
How to use brushes and colors with the SolidColorBrush class in code.
Keywords | Brush | Brushes | Color | Colors | ARGB | FromArgb | hex color | BitConverter | ColorDialog | Equals | Freeze | Freezable | Clone | XamlReader | XamlWriter | XAML |

How to test if a file is changed.
Testing a file with a hash whether it has any changes.
Keywords | Hash | SHA256Managed | Base64 | ZIP |

How to add an image to a button.
Adding an image from resource file to a button with a pack URI.

How to make a flat Button.
A custom made flat button with rounded corners and an image.
Keywords | flat button | FlatStyle | toolbar | pack Uri |

How to make a NumericUpDown Control.
A custom made NumericUpDown Control for WPF.
Keywords | spin box | RepeatButton | Increment | Maximum | Minimum | OnValueChanged |

Duo DataGridView.
Synchronized scrolling for two DataGridView controls.
Discontinued - Replaced by 'How to scroll two ScrollViewers simultaneously.'

How to scroll two ScrollViewers simultaneously.
Synchronized scrolling of two ScrollViewer controls by mutual feedback.
Keywords | ScrollViewer | scroll-bar | ScrollToHorizontalOffset | ScrollToVerticalOffset |

How to make an XML (XAML) editor.
A basic editor with line numbers and a validator for XML and XAML.
Keywords | Editor | line numbers | XML | XAML | Grid | GridSplitter | RowDefinition | ColumnDefinition | SetColumnSpan | ScrollViewer | validator | well-formed | XmlException | XamlParseException |

How to create vertical text.
Make vertical text or position it at any angle.

How to animate a Control or a Shape.
Animating a FrameworkElement or Freezable with BeginAnimation and Storyboard.

How to make a DataMatrix barcode - Part 1.
Creating a DataMatrix barcode as PNG with the IEC16022Sharp library.

How to make a DataMatrix barcode - Part 2.
Encoding and decoding a DataMatrix barcode with the DataMatrix.net library.

How to find elements in a logical tree.
Searching elements in a tree by name, as item or as child.

How to make a graph.
Drawing a graph from an array with data.

How to use the Calendar Class (System.Globalization).
Get the days in a year with date, day number, week number and other info.
Keywords | Calendar | DateTime | MonthCalendar | DateTimePicker | DatePicker | leapjear | GetDaysInYear | GetWeekOfYear | GetMonth | Day | CalendarWeekRule | TimeSpan |

How to serialize related data to a single XML file.
Store several pieces of related data in a single XML file with the XmlSerializer.
Keywords | XML | XmlSerializer | Serializable | XmlRoot | XmlArray | XmlArrayItem | StreamWriter | StreamReader | RNGCryptoServiceProvider |

How to use XML resource files.
Adding an XML resource file to a project and retrieving its contents at runtime.
Keywords | Resource | GetResourceStream | LoadComponent | StreamReader | Stream | XmlDocument | XDocument | IEnumerable | Dictionary | pack URI | XML | LINQ |





XBAP

XBAP (XAML Browser Application) is a WPF-application running in the browser. It needs Internet Explorer 6.0 or higher and .NET Framework 3.0 or higher.

How to make an XBAP.
Creating and deploying a XAML Browser Application.
Keywords | XBAP | XAML Browser Application | WPF Browser Application | Page | iframe | Mage.exe |



XPS

XPS (XML Paper Specification) is a page-oriented document format (electronic paper) and a printer-format. It is a zip-container (.xps) with XML pages and XAML and it can be used as eBook with or without DRM.

The XPS document structure.
The basic structure of an XML Paper Specification (XPS) fixed document.

XPS in Windows XP.
Installatie en het gebruik van 'XML Paper Specification' (XPS) documenten in Windows XP SP2.

XAML Elements in XPS
An overview of XAML elements used in XPS.

XPS in Word 2007.
Make XML Paper Specification (XPS) and PDF documents with Word 2007 and OpenOffice Writer.

XPS document Viewer.
A custom made XPS document viewer with search, zoom and print functions.

Paginated XAML webpages.
Paginated webpages with XAML, printing them as document to PDF or XPS



SVG

Scalable Vector Graphics (SVG) is a language for describing two-dimensional vector graphics in XML defined by the World Wide Web Consortium (W3C).

RELAX NG schemas for SVG.
An overview of SVG, SVG Tiny, SVG Basic versions and RELAX NG schemas for them.

SVG
An introduction to Scalable Vector Graphics

Making SVG vector graphics with Inkscape.
How to make SVG images and transparent PNGs with vector graphics editor Inkscape.

SVG Inventarisatie.
Scalable Vector Graphics gebruiken in webpagina's.
This article will be updated when the final version of IE9 is available.

SVG to XAML converter.
Converting SVG to and from XAML with XSLT.

Validation of SVG Tiny.
Validation of SVG Tiny with a RELAX NG schema in C#.

Validation of SVG.
Validation of SVG Full with a RELAX NG schema in C#.



XHTML

Extensible HyperText Markup Language is defined by the World Wide Web Consortium (W3C).
In this section XHTML (XHTML 1.0, Module-based XHTML) and (X)HTML5.

HTML Applications (HTA).
An introduction to HTML Applications.

HTA Setup shell.
Een Setup shell maken voor meerdere installaties.

Validation of XHTML Basic.
Validation of XHTML Basic with a RELAX NG schema in C#.

The RFC 2397 data URL - Part 1.
Inline Base64 images in (X)HTML.

The RFC 2397 data URL - Part 2.
Base64 converters for making image data URLs.

XAML graphics in XHTML.
How to embed XAML graphics in (X)HTML with the iframe element.



XML

The Extensible Markup Language (XML) is a subset of SGML defined by the World Wide Web Consortium (W3C).

XML validation.
How to test if an XML-document is well-formed.
Keywords | validation | well-formed | syntax | parser | XmlReader | XmlReaderSettings | XmlException | DTD | DOCTYPE | XmlDocument | element | attribute | Internet Explorer | Opera | XSD Inference Utility | XmlSchemaInference | XML |

XML validation with an XML schema (XSD).
Validating an XML document with a schema generated with the XmlSchemaInference class.
Keywords | validation | validator | schema | structure | well-formedness | XML schema | XSD | XML | XmlSchemaInference | XmlSchemaSet | XmlSchema | XmlReader | XmlReaderSettings | ValidationType | IXmlLineInfo | XmlSchemaValidationException | XmlException |

XML validation with RELAX NG.
A RELAX NG validator for .NET using Commons.Xml.Relaxng from Mono.
Keywords | validator | schema | RELAX NG | Mono | XML | RNG | MIT X11 |

Indenting XML.
How to indent XML to make it better readable for humans and validators.
Keywords | XML | indentation | indented | XmlWriter | XmlWriterSettings | IndentChars | XDocument | validation |

Escaping text for XML.
Several ways to escape text for XML.
Keywords | Escape | well-formed | ISO-8859-1 | HtmlEncode | HtmlDecode | Encoding.GetEncoding | SecurityElement.Escape | XMLSerializer | XDocument | LINQ | XML |

Lists in XHTML and XML.
An overview of lists in (X)HTML and adopting them as data-structures in XML.
Keywords | list | list item | list-style | List(T) | ordered | unordered | definition | CSS | HTML | XHTML | XML | XSLT | transformation | XslCompiledTransform | XDocument | XElement | LINQ |

DocBook
A markup language for documentation.

Validation of DocBook 5.0 documents.
How to validate DocBook documents with the DocBook V5.0 RELAX NG schema in Windows.

Exporting text as DocBook.
How to export text data in DocBook 5.0 format from a .NET application (C#).

RSS Basics.
Maak nieuwsberichten met RSS-feeds en voeg die toe aan een website.
Discontinued.

Atom Feeds.
Creating Atom feeds from code and validating them with a RELAX NG schema.
Keywords | feed | Atom | RSS | feed builder | feed reader | guid | SyndicationFeed | Atom10FeedFormatter | SyndicationItem | XmlWriter | XmlWriterSettings | XmlReader | validator | RELAX NG | XML | IETF | RFC 4287 | RFC 5988 |

Atom Feed and Entry Documents.
A set of functions to work with Atom Feed and Entry Documents as modules.
Keywords | Atom | RSS | Atom Feed Document | Atom Entry Document | feed | entry | syndication | extension | List | IENumerable | ID | guid | SyndicationFeed | SyndicationItem | Atom10FeedFormatter | XmlReader | XmlWriter | XmlWriterSettings | MemoryStream | xDocument | LINQ | XML | schema | RELAX NG | FeedSync |

Speech Synthesis Markup Language (SSML).
Text to Speech with SSML and the SpeechSynthesizer class.
Keywords | SSML | Speech Synthesis Markup Language | text to speech | element | attribute | meta | speech | speak | voice | SpeechSynthesizer | SpeakSsml | SetOutputToWaveFile | SetOutputToDefaultAudioDevice | WAV | MP3 | LAME encoder | audio | XML | XmlDocument | XmlNodeList | XmlNode | XML editor | validator | well-formed | RareWares |

SSML bookmarks and meta data.
Asynchronous speech with SSML, implementing bookmarks and meta data.
Keywords | Speech Synthesis Markup Language | SSML | SpeachSynthesizer | meta | mark | SpeakSsmlAsync | SpeakCompleted | BookmarkReached | XmlDocument | XML |

E-books in EPUB format - Part 1.
An introduction to create e-books in EPUB format by hand.
Keywords | e-book | Reader | EPUB | epub | ePUB | IDPF | OPS | OPF | OCF | XML | XHTML 1.1 | NCX | MIME type | UTF-8 | reflowable | table | cover page | chapter | paragraph | navigation | page | fragment identifier | metadata | manifest | spine | guide | navMap | navPoint | toc | table of contents | SVG viewBox | XLink | div | id | uid | CSS | zip | archiver | Deflate | compression | package | archive | container | validation | well-formed | XML Schema | RELAX NG | guid | Sony Reader PRS-T1 | DRM | USB | Removable Disk | microSD |

E-books in EPUB format - Part 2.
Validating EPUB with RELAX NG schemas.
Keywords | e-book | EPUB | IDPF | OPF | OCF | OPS | content document | package | schema | well-formed | validator | table of contents | TOC | NCX | DAISY/NISO | Digital Talking Book | mimetype | signature | encryption | XHTML | XML | RNG | RELAX NG | James Clark | Jing |