Frage

In a Metro App, when retrieving the Thumbnail of a StorageFile using the GetThumbnailAsync() method, the Background Color is a Dark Blue/Navy Blue.

Is it possible to override this Color? I would like the Background to be Transparent.

War es hilfreich?

Lösung

From the documentation,

The thumbnail is an icon on a background of appropriate size. The background color is determined by the app that is associated with the file.

Combined with the following note:

Note If the associated app is a Windows Store app, the app's tile background color is used.

If your app has an association with the file, just make sure your apps Background color is Transparent (not 100% sure you can do that, actually).

The other option is to use something like WriteableBitmapEx to find every pixel of the tile color, then turn those pixels to Transparent. Shouldn't be too absolutely terrible, but will have an overhead (naturally).

Hope this helps and Happy Coding!

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top