You can get the source code for my WPF Photo Print utility here and on CodePlex.  Some interesting bits are:

  • All transformations are applied to Drawing objects.  Take a look in the ‘Transformations’ folder and you’ll notice creating new ones is just a case of overriding GetDrawing.
  • The crop selection uses an Adorner (based on an MSDN sample) combined with an OpacityMask (see Preview.xaml) and plenty of data binding.
  • Although it’s designed for photo printing, the transformations could be applied to any base drawing.  Just derive something from Transformable; it should (could) even work for video :)
  • Currently it only prints the results, but it’d be a piece of cake to draw to a RenderTargetBitmap and save to a file (in any DPI you choose).

Hope you find it useful (I’ve already printed plenty of photos with it — it’s great! :) )

About these ads