Category Archives: serialization

Let the user zoom on a picture and draw in C#

The example Let the user zoom on a picture in C# allows the user to zoom in on a picture and draw on it. Unfortunately, it doesn’t handle the drawing properly when the image is scaled. It doesn’t scale the … Continue reading

Posted in drawing, files, graphics, serialization, transformations | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 1 Comment

Extract part of a JSON file in C#

This example shows how to read a JSON file and pick out only the pieces that are interesting. Recall from my post Anatomy of an example that my original goal with this series of articles was to write a program … Continue reading

Posted in algorithms, files, serialization | Tagged , , , , , , , , , , , , , | 1 Comment

Use JSON to serialize and deserialize objects in C#

JSON (JavaScript Object Notation) is a standard for textual storage and interchange of information, much as XML is. Before you roll your eyes and ask if we really need another language to do what XML does, consider how verbose XML … Continue reading

Posted in algorithms, serialization | Tagged , , , , , , , , , , , , | 1 Comment

Control serialization and deserialization in C#

For information on basic serialization and deserialization, see Serialize and deserialize objects in C#. By placing attributes on a class’s properties, you can control how those properties are serialized. The following code shows a Person class that demonstrates several XML … Continue reading

Posted in algorithms, serialization | Tagged , , , , , , , | Leave a comment

Serialize and deserialize objects in C#

Serialization is the process of converting an object into a serial stream-like format. Often that means converting it into XML data for storage or transmission over a network. Deserialization is the process of using a serialization to rebuild the original … Continue reading

Posted in algorithms, serialization | Tagged , , , , , , , , | 1 Comment

Let the user zoom on a picture in C#

Important: This example does not handle new drawings correctly if you have scaled the image. Read this one to learn how it works and then see the new post Let the user zoom on a picture and draw in C#. … Continue reading

Posted in drawing, files, graphics, serialization | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 1 Comment

Provide autosave in C#

This example extends the scribble example (most recently described in the post Provide undo and redo in C#) so it provides an auto-save feature. The following code creates the name of the program’s auto-save file. // The auto-save file name. … Continue reading

Posted in drawing, files, graphics, serialization | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 1 Comment

Provide undo and redo in C#

This example adds undo and redo features to the example Save and restore pictures drawn by the user in C#. It’s not terribly hard, but it is long so I’ll break it into sections to make it easier to understand. … Continue reading

Posted in drawing, graphics, serialization | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 1 Comment

Save and restore pictures drawn by the user in C#

The example Let the user scribble with different line styles in C# explains how to let the user draw curves with different colors, line thicknesses, and dash patterns. This example adds the ability to save and load pictures drawn by … Continue reading

Posted in drawing, graphics, serialization | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , | 3 Comments

A plea for help: Tell me what you want to see in my blog!

I get remarkably little feedback from my blog. I track post views and know that I have 857 Twitter followers, but people rarely let me know if they particularly like or dislike a post. That makes it hard for me … Continue reading

Posted in ADO.NET, algorithms, animation, API, challenges, combinatorics, controls, cryptography, curve fitting, database, extension methods, files, fonts, fractals, games, geometry, globalization, graphics, internationalization, LINQ, localization, mathematics, Office, phone, printing, reflection, registry, serialization, threading, transformations, user interface, Word, wpf, XAML, XML | 13 Comments