简体   繁体   English

如何使用Xamarin将jpg图像添加到Visual Studio的IOs项目

[英]how to add jpg image to IOs project for Visual studio with xamarin

I got a problem in my project in Visual studio with Xamarin. 我在Xamarin的Visual Studio项目中遇到问题。 I want to add a .jpg image to images sets in IOS project's asset catalog. 我想向IOS项目资产目录中的图像集添加.jpg图像。 But VS allow me add only .png files. 但是VS只允许我添加.png文件。 Is there any way to add .jpg image to use it in storyboard and in code. 有什么方法可以添加.jpg图像,以便在情节提要和代码中使用它。

You can add them under the folder Resources . 您可以将它们添加到“ Resources ”文件夹下。 Detail Refer Working With Resources 详细信息请参阅使用资源 在此处输入图片说明

Usage: 用法:

In Code 在代码中

image.Image = UIImage.FromBundle("test.jpg");

In Storyboard 在情节提要中 在此处输入图片说明

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

相关问题 无法使用 Visual Studio 2022 将图像添加到 Xamarin.iOS 项目中的 xcassets - Unable to add image to xcassets in Xamarin.iOS project with Visual Studio 2022 如何在Visual Studio中从Web项目的图像文件夹中正确添加和浏览图像 - How to properly add and browse images from image folder of web project in visual studio 如何将图像添加到我的 Xamarin.Forms 共享项目的资源中,以便在 ZE84E30B9390CDB64DB6DB2C9EBZAB87846DZ204DB4BDF6050829 - How to add an image to my Xamarin.Forms shared project's resources so that it can be used in both the Android and iOS projects? iOS-以jpg格式保存图像 - iOS - save image in jpg format 重新在Visual Studio 2012中添加图像资源 - Re add image resource in Visual Studio 2012 如何将 jpg 或 png 图像添加到 UIImage 然后显示在 UIImageView 中? - How to add a jpg or png image to an UIImage and then display in a UIImageView? 如何在iOS(Xamarin)中的按钮上设置干净的图像 - How to set clean Image on Button in ios(Xamarin) Visual Studio 未在非项目文件中导入简单图像 - visual studio not importing simple image in a non project file 如何在Visual Studio中产生内存映像 - How to produce a memory image in Visual Studio 在 Visual Studio 中,如何解决 Button 图像质量? - In Visual Studio, how to solve Button image Quality?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM