在OnLoaded()方法中显示图像之前,我试图获取图像的尺寸。我想同步(而不是异步)执行此操作,因为我需要在程序继续之前知道图像的尺寸。我正在制作一个map程序,其中背景图像的坐标、比例和平移偏移量很重要,并且都依赖于从应用程序一开始就知道图像的尺寸。我已经阅读了大部分关于StorageFile、SoftwareBitmap和异步方法调用的msdn文档,并尝试了很多我在网上找到的方法但没有成功。https://msdn.microsoft.com/en-us/windows/uwp/threading-async/asynchronous-programming-universal-