You don't reference things in the Resources folder by their path. You would
reference the via their resource id.  So, in your case:

Drawable d = Resources.GetDrawable(Resource.Drawable.test);




On Sat, Jan 12, 2013 at 4:08 AM, Canning <[email protected]> wrote:

> I am using MonoDevelop for Android and have a question about loading a
> resource from a file.
>
> Here is my code:
>
>     static public Drawable CreateFromFilename (string stringFilename)
>     {
>         //String pathName = "/path/to/file/xxx.jpg";
>         Drawable d = Drawable.CreateFromPath(stringFilename);
>         return d;
>     }
> In my application, I am wishing to check to see if a image is located in a
> folder on the cellphone, and if it is, I wish to load it via the above
> code.
> If the image is not there, I wish to download it off the WWW, save it to a
> folder, and then load it in via the above code.
>
> My question is this: If I create an Android application, that has a file
> called 'test.png' in the 'Resources/drawable/' folder, what is the correct
> path to use to load this image file via the above function?
>
>
>
> --
> View this message in context:
> http://mono-for-android.1047100.n5.nabble.com/Android-load-resource-from-drawable-folder-tp5712744.html
> Sent from the Mono for Android mailing list archive at Nabble.com.
> _______________________________________________
> Monodroid mailing list
> [email protected]
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>



-- 
http://www.opgenorth.net
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to