Load an Image

PDF for offline use:
Sample Code:
Related SDKs:

This recipe shows how to load and display an image.

Recipe

To display an image:

  1. Add the image to your Xamarin.iOS project and ensure the Build Action is set to BundleResource.
  2. Create a UIImageView and add the image using UIImage.FromBundle:
var imageView = new UIImageView (UIImage.FromBundle("MonkeySFO.png"));
imageView.Frame = new CoreGraphics.CGRect (10,10,imageView.Image.CGImage.Width, imageView.Image.CGImage.Height);