First question: Which version do you use? I tested your code with the newest source and all my comments are about this version. I also recommend to build the latest version, you can also profit from a bug in the gif decoder, which I have fixed while testing
About your code:
(1) It looks fine more or less: If you just want to display a gif, I recommend to use AnimatedImage control instead of the default Image control. It supports all file formats and also handles multithreading stuff and animates your gif (if it is animated).
(2) If you need a writablebitmap just use the ToBitmap extension Method instead of ToStreamByExtension. Its much faster.
(3) ImageTools works asynchronously be default. SetSource loads the image in background. Consume the ImageLoaded event, but have in mind, that your event handler will raised in another thread than the gui thread and you have to use the Dispatcher. If you
want to make it Synchronously, the Image class has a property IsLoadingSynchronously. Set this property to true, before calling SetSource...
(4) Register the gif decoder first: Decoders.AddDecoder<GifDecoder>();
(5) Do you want to save the writeablebitmap, because it will be manipulated or the loaded image?
If you want to save the writablebitmap just do the following:
var image = myBitmap.ToImage(); // Where myBitmap is an instance of the WritableBitmap
Now you can just save the image. First add the reference to the Jpeg Assembly, than register the Encoder: Encoders.AddEncoder<GifEncoder>();
Then just call image.ToStreamByExtension("jpeg"); to get a jpeg stream.
I hope this answers all your questions.