In CachedImage::finishLoading(), the SharedBuffer parameter should have the raw data of the image. The data in this buffer is the content of the image file. BitmapImage::dataChanged() might be a better place to alter the image data if you want your solution to be specific to bitmap images.