title: Xamarin local image from file or resources
body: <p>I cannot get my images to show up in Android at all.  I have tried with ImageSource.FromFile and ImageSource.FromResource.</p>
  
  <p>I have read "Working with Images" several times and just don't see what I am doing wrong.</p>
  
  <p>From File Example</p>
  
  <pre><code>        var myImage = new Image() {
              Aspect = Aspect.AspectFill,
              Source = ImageSource.FromFile("backdrop.jpg")
          };
  
          RelativeLayout layout = new RelativeLayout();
  
          layout.Children.Add(myImage,
              Constraint.Constant(0),
              Constraint.Constant(0),
              Constraint.RelativeToParent((parent) =&gt; { return parent.Width; }),
              Constraint.RelativeToParent((parent) =&gt; { return parent.Height; }));
  
          Content = layout; 
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/M9QGO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M9QGO.png" alt="enter image description here"></a></p>
  
  <p>The Build Action is set to: AndroidResource</p>
  
  <p>I always get the NullReference exception with this path</p>
  
  <p><a href="https://i.stack.imgur.com/uznZ8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uznZ8.png" alt="enter image description here"></a></p>
  
  <p>FromResource example</p>
  
  <pre><code>        var myImage = new Image()
          {
              Aspect = Aspect.AspectFill,
              Source = ImageSource.FromResource("TTMD_Mobile.Droid.backdrop.jpg")
          };
  
          RelativeLayout layout = new RelativeLayout();
  
          layout.Children.Add(myImage,
              Constraint.Constant(0),
              Constraint.Constant(0),
              Constraint.RelativeToParent((parent) =&gt; { return parent.Width; }),
              Constraint.RelativeToParent((parent) =&gt; { return parent.Height; }));
  
          Content = layout;
  </code></pre>
  
  <p>The Build Action is set to: Embedded Resource</p>
  
  <p>With the FromResource I don't get any exception, just the image doesn't show.</p>
  
  <p>I am fairly new to Xamarin and Android development, my apologies if this has been addressed, I couldn't find a working solution.</p>
  
  <p>EDIT: I do not believe this is a duplicate of that question, I have my images in their correct locations I believe.</p>