Load an Image

PDF for offline use
Sample Code:
Related SDKs:

Let us know how you feel about this


0/250

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);

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.