Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource bitmap loading #13

Merged
merged 3 commits into from
Jul 15, 2013
Merged

Resource bitmap loading #13

merged 3 commits into from
Jul 15, 2013

Conversation

anaisbetts
Copy link
Member

This PR adds support to load bitmaps from the app's resources - this is handy for loading canned default images in ViewModels, etc etc.

A weird caveat

Resources in Android are defined by ints, not strings, so you have to do something like:

var theImage = await BitmapLoader.LoadImageFromResource(R.someCoolImage.ToString());

anaisbetts pushed a commit that referenced this pull request Jul 15, 2013
@anaisbetts anaisbetts merged commit e4376df into master Jul 15, 2013
{
// NB: I'm sure there's a way to return a constant as a Task but
// I'm too lazy to look it up.
return Task.Run(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Task.FromResult is your friend?

@anaisbetts anaisbetts deleted the resource-bitmap-loading branch December 19, 2013 01:04
@lock lock bot locked and limited conversation to collaborators Jun 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants