Using an image file with a Tizen.NET wearable application (using Visual Studio)

267 Views Asked by At

I'm a beginner with Tizen.NET and am wanting to utilise images created on my development machine in my wearable app. I have created a sample TizenWearable app in Visual Studio.

I have saved a circle-cropped.PNG image file in shared/res

enter image description here

I have added the following code to test using the image as a background image:

    // The root page of your application
    MainPage = new ContentPage
    {
        BackgroundImageSource = "circle-cropped.png",
        Content = new StackLayout
        {
            VerticalOptions = LayoutOptions.Center,
            Children = {
                new Label {
                    HorizontalTextAlignment = TextAlignment.Center,
                    Text = "Welcome to Tizen!"
                },
                button,
                label,
                button2
            }
        }
    };

However when I run the emulator to check, my other labels and buttons render fine, but the background is black, with no image.

enter image description here

If I run the emulator shell, I can see my image seems to be included on the file system:

sh-3.2$ ls
TizenWearableApp1.png  circle-cropped.png
sh-3.2$

Where am I going wrong here?

1

There are 1 best solutions below

4
On BEST ANSWER

You should place your resources in res folder.

The shared/res folder is meant for sharing resources with other applications and private application resources shouldn't be placed there.