Sample app demonstrating Ink, printing, and in-app purchases for the Universal Windows Platform.
C#

README.md

Coloring Book UWP app sample

A mini-app that explores Windows Ink and Monetization features using the Windows Store. Specifically, it allows users to purchase coloring page collections and then color with Windows Ink. This sample runs on the Universal Windows Platform (UWP).

Using Ink in your UWP app video

Features

Coloring Book demonstrates:

  • Using the Windows.Services.Store API for managing in-app purchases
  • Customizing Windows Ink experiences with custom tools and pages
  • Saving Windows Ink onto an image
  • Manipulating Windows Ink with other files to save, open, export, share, and print

UWP development

This sample requires Visual Studio 2015 and the Windows Software Development Kit (SDK) for Windows 10 Anniversary. Get a free copy of Visual Studio 2015 Community Edition with support for building UWP apps. Additionally, to be informed of the latest updates to Windows and the development tools, join the Windows Insider Program.

Running the sample

The default project is ColoringBook, and you can Start Debugging (F5) or Start Without Debugging (Ctrl+F5) to try it out. The app will run in the emulator or on physical devices.

To enable the in-app purchases code:

  1. Follow the instructions to test in-app purchases to get a Package.StoreAssociation.
  2. Add storeIds in Constants.cs
  3. #define STOREASSOCIATION in PickColoringPage.cs

Adding in-app purchases to your UWP app video

Code at a glance

If you’re just interested in code snippets for certain API and don’t want to browse or run the full sample, check out the following files for examples of some highlighted features:

In-app purchases:

  • PickColoringPage.xaml.cs verifies if the coloring page collection has been purchased, and if not, allows the user to purchase the collection.
  • Constants.cs maintains a dictionary of the storeIds associated the coloring page collections.

Windows Ink:

Printing:

  • PrintSample is slightly modified from the Windows Printing Sample – ColoringPage sends PhotoPrintHelper a stream to print.

See also

Monetize documentation
Pen and stylus documentation