WPF (RSS)

Reading XMP MetaData Keywords with WPF

WPF has an interesting way to read metadata associated with a photo.  All metadata can be extracted using the BitmapMetaData object.  The BitmapMetaData object supports the various metadata schemas including: Exif, tEXt, IFD, IPTC and XMP.

Here's a simply way to read an existing image's metada with C#:

BitmapMetadata metadata = (BitmapMetadata)myImage.Source.Metadata;

MessageBox.Show(metadata.Title);

Looking at the BitMapMetaData, you can find out all sorts of information such as camera model, date taken, caption, etc.  In particular, I was interested in reading the Tags added by Windows Photo Gallery in Vista.  The Microsoft Photography Blog article states that "All metadata written to photos by Windows Vista will be written to XMP (always directly to the file itself, never to a ‘sidecar’ file)."  Furthermore, I found that the tags are stored in the keywords collection in the metadata. Simple enough. I expanded my sample yesterday to display the tags associated with an image when it's selected. 

I haven't figured a way to programmatically add new tags to the images yet. I have some code in the demo to add new tags using the InPlaceBitmapMetadataWriter object that doesn't work. Let me know if I'm missing something.

An aside, the demo now also supports multiple files drag and drop.  I also cleaned up the styling a bit.

DragDropMedia2

Source: http://blogs.vertigosoftware.com/files/alan/dragdropmedia.zip

Compiled and Programmed with .NET 3.0 Framework.

posted by AlanL with 5 Comments

WPF Intra-App Drag Drop

I wanted to learn about drag and drop to a WPF application so I created this little demo. It's a simple app that accepts jpeg images and will display them when you drag files from windows explorer or photo gallery.  It also shows a copy DragDropEffect and a nsupported effect whether the files are supported or not.

This msdn help article explains more about Drag and Drop support in WPF.

Drag Drop Media

Source: http://blogs.vertigosoftware.com/files/alan/dragdropmedia.zip

posted by AlanL with 4 Comments

Install path for working with WPF

I want to get started working with Windows Presentation Foundation (WPF).  Good thing for me, Tim Sneath has compiled a complete list of links to the necessary installation files.  Perfect!

Also if you like the "How do I..." set of videos for ASP.NET 2.0 and Atlas, I found Fil Fortes screencast video demo on Channel 9 as the closest thing and an excellent, whirlwind demo of development for WPF.

posted by AlanL with 0 Comments