Archive for November, 2008

HP TouchSmart software update: Touch Optimizer

November 20, 2008 11:06 pm

Lots of people find that once they’re outside the touch optimized environment that the HP TouchSmart software provides, things in Vista are not all that easy to use with touch.

This is something we addressed with what we called a “Touch Optimizer” on the IQ770 (our first TouchSmart series). On the IQ500 series we initially left this program out of the factory configuration (the reasons would bore you, trust me.) Now we’ve brought it back as an update that you can get at the HP Support website: http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=pv-66423-1&lc=en&dlc=en&cc=us&lang=en&os=2100&product=3752240

This utility will increase several “non-client metrics”, as they’re called in Windows developer lingo, to sizes that make things easier to hit with your finger. If I remember correctly, the tool increases scrollbar, close/minimize/maximize buttons and taskbar quicklaunch icon sizes. It also turns on single click for desktop icons so you don’t have to double-tap to launch programs from the desktop anymore.

Until Windows 7 arrives with better integrated touch in the whole OS, try this tool and see if it doesn’t get you 60% of the way there. Maybe even 80%.

WIC metadata in .NET: Getting around "Property cannot be found" / System.ArgumentException /"Exception from HRESULT: 0x88982F40"

November 16, 2008 9:39 pm

Here’s a bit of an obscure error message I’ve run into while working with WIC (Windows Imaging Component) on .NET/WPF, trying to write XMP metadata into an image:

image

 

 

 

 

 

 

 

 

 

 

So far, a search on Google has yielded few usable results. I hope this post will change that, yielding at least one useful thing.

The Exception message tells you that you’re trying to write data to a property that doesn’t exist in the file. Microsoft has a tool called WICExplorer that can show you the metadata like this:

WIC_Before

The above shows an image in WICExplorer directly after coming off of my digital camera. Notice that there is no “XMP Reader” node, which would represent XMP metadata. So if you want to put new XMP metadata into the picture, you need to know two things: how to create a new metadata node and what the correct syntax is for doing so.

What helped me figure those two things out were these pages:

http://social.msdn.microsoft.com/forums/en-US/wpf/thread/8f297b11-99ba-459c-b085-1ff3ae526487/

http://msdn.microsoft.com/en-us/library/bb643802.aspx

The first one showed how one can create new metadata objects using WIC, the second showed the needed syntax for some of the queries.

So here’s an example of how to create XMP metadata in an image that doesn’t have XMP metadata embedded yet:

   1: string file = "C:\Temp\IMG_1687.JPG";
   2: BitmapCreateOptions createOptions = BitmapCreateOptions.PreservePixelFormat | BitmapCreateOptions.IgnoreColorProfile;
   3: Stream originalFile = File.Open(file, FileMode.Open, FileAccess.ReadWrite)
   4: BitmapDecoder original = BitmapDecoder.Create(originalFile, createOptions, BitmapCacheOption.None);
   5: BitmapMetadata metadata = original.Frames[0].Metadata.Clone() as BitmapMetadata;
   6:  
   7: string q = "/xmp/exif:UserComment/x-default";
   8: if (metadata.ContainsQuery(q))
   9: {
  10:   metadata.SetQuery(q, comment);
  11: }
  12: else
  13: {
  14:   metadata.SetQuery("/xmp/exif:UserComment", new BitmapMetadata("xmpalt"));
  15:   metadata.SetQuery(q, comment);
  16: }

The keys are in line 7, where the initial metadata query is shown and in line 8, where the code tests if the metadata is already present. If not, line 14 shows how to create a new XMP metadata node, which then gets populated in line 15. The writing of the data can be done using a JpegBitmapEncoder according to Robert Wlodarczyk’s blog post (without the InPlaceBitmapMetadataWriter piece.)

After running code like this, you’ll now have the metadata in the file, as shown by this WICExplorer screenshot (I added “App0 Reader” metadata to this image as well):

WIC_After

Hopefully this is useful to some folks out there. Enjoy!

Steven Sinofsky’s Vista UAC discussion at PDC 2008

November 14, 2008 10:36 am

One thing I haven’t written about yet is my impression of a few moments in Steven Sinofsky’s PDC 2008 keynote. It was when he talked about User Account Control. UAC was not well received when it was put in Vista, to put it mildly.

At around 45 minutes in the keynote, Steven mentions UAC and, as far as I can tell, pauses deliberately for a second or two to get an audience reaction. If you weren’t in the room at the time, it’s hard to tell, but there was a collective groan and some chuckling at that point.

I think it’s the closest attempt at trying to apologize for a design blunder I’ve ever seen Microsoft make, albeit without words. I found it to be a brave move for someone like Steven to make, and I wager that it put a more human face on the large, often faceless corporation that is Microsoft. It certainly did for me.

If nothing else it gave me the impression that there is someone at the helm of Windows development who is not afraid of acknowledging when things go wrong and who will try to make up for it. I find that very refreshing.