简体   繁体   English

如何裁剪和调整LiveTile图像的大小

[英]How to crop and resize an image for a LiveTile

I would like to be able to add an image to a live tile so that there is no stretching and the image looks normal. 我希望能够将图像添加到活动图块,以便没有拉伸并且图像看起来正常。 I am getting my images from the PhotoChooserTask, which contain images from the medialibrary. 我正在从PhotoChooserTask获取图像,其中包含来自媒体库的图像。 As of now I can successfully place an image on a live tile, but it is stretched and the aspect ratio is not correct. 到目前为止,我可以成功地将图像放置在活动图块上,但是它已经拉伸并且纵横比不正确。 How would I be able to find the aspect ratio of the image and crop the image so that it ends up being a square with dimensions 173x173 with no streching? 如何找到图像的长宽比并裁剪图像,使其最终成为尺寸为173x173且没有拉力的正方形? I have followed a couple tutorials found online but nothing seems to accomplish this the way I need it to. 我遵循了一些在线上找到的教程,但是似乎并没有达到我需要的方式。

我通过为Live Tile引用“ 调整大小”图像来实现这一目的-WriteableBitmapEx ,事实证明它具有正确的实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM