How to resize bitmap image to be <200 KB and meet Tile restrictions (WinRT)

后端 未结 2 1456
南笙
南笙 2021-01-15 08:39

I am developing a routine to scale some bitmap images to be part of tile notifications for my Window-8 app

The tile images must be <200KB and less than 1024x1024

相关标签:
2条回答
  • 2021-01-15 09:27

    Can you not calculate it using width x height x colourDepth (where colourDepth is in bytes, so 32bit=4bytes). Presumably you're maintaining aspect ratio so you just need to scale down width/height until you find it less than 200KB.

    This assumes the output is an a bitmap and therefore uncompressed.

    0 讨论(0)
  • 2021-01-15 09:34

    Considering that tile size either 150x150 for square tiles or 310x150 for wide tiles you should be able to shrink image down to the appropriate size and with jpeg compression you are pretty much guaranteed to be under 200k. Set compression quality around 80. It will give you good compression ratio while keeping decent image quality.

    0 讨论(0)
提交回复
热议问题