UWP image scaling with Xamarin Forms

只愿长相守 提交于 2019-12-13 03:04:37

问题


I am creating a iOS, Android, UWP app with Xamarin Forms. I am well versed in how the iOS and Android platforms handle image scaling (1x, 2x, 3x, etc). However, I am not so familiar with UWP.

In UWP you can have different image sizes to handle different scaled screen sizes. Here are 3 different sized versions of the same image.

So my questions

  1. Is the 100 scale size is the image used when the Windows user has chosen no scaling of the screen (100%)?
  2. Are the 200 and 400 scale sizes for when the user tells Windows to make everything 2x or 4x bigger?
  3. What image size does Xamarin UWP choose when the Windows scale factor is 125, 250, or some other random factor that doesn't match up with any of the scale factors for the image?

回答1:


Is the 100 scale size is the image used when the Windows user has chosen no scaling of the screen (100%)?

I think it is, for scale factor, 100,200,400...

Are the 200 and 400 scale sizes for when the user tells Windows to make everything 2x or 4x bigger?

Windows automatically selects a scale factor for each display based on its DPI (dots-per-inch) and the viewing distance of the device. You should create your images at several recommended sizes (at least 100, 200, and 400) so that Windows can either choose the perfect size or can use the nearest size and scale it. So that Windows can identify which physical file contains the correct size of image for the display scale factor, you use a scale qualifier.

I find there are two articles that you can take a look:

https://docs.microsoft.com/en-us/windows/uwp/app-resources/images-tailored-for-scale-theme-contrast

https://docs.microsoft.com/en-us/windows/uwp/app-resources/tailor-resources-lang-scale-contrast



来源:https://stackoverflow.com/questions/56633408/uwp-image-scaling-with-xamarin-forms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!