Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

How to load images with Forms?

$
0
0

Hello!

I try to load images like in tutorial with Xamarin.Forms.
I made solution and projects like described here - http://forums.xamarin.com/discussion/comment/64979#Comment_64979

Than I add into this -
public void ForInstanceDisplayAlert()
{
//code from Xamarin.Forms tutorial
var MyImage = new Image { Aspect = Aspect.AspectFit };
MyImage.Source = ImageSource.FromFile("testfile.png");

                    //MyImage.Source = ImageSource.FromResource ("scr_35.test1.png");

        //var webImage = new Image { Aspect = Aspect.AspectFit };
        //webImage.Source = ImageSource.FromUri(new Uri("http://xamarin.com/content/images/pages/forms/example-app.png"));
        //bool result = await DisplayAlert ("added forms functionality", "hello from forms", "OK", "Cancel");
        //return;

    }

testfile.png in Resources/Drawable
and..nothing happened. I can't see image. Just black screen.


Viewing all articles
Browse latest Browse all 58056

Trending Articles