In MonoTouch:
I am putting in an image from the Camera into the PhotoAlbum:
ALAssetsLibrary library = new ALAssetsLibrary();
library.WriteImageToSavedPhotosAlbum(photo.CGImage, meta, (assetUrl, error) => {
library.AssetForUrl(assetUrl, GotAsset, FailedGotAsset);
});
The Photo
is all there, works well.
On the delegate GotAsset
I am attempting to get out the image, but only the Thumbnail is there. Where is the image?
void GotAsset(ALAsset asset)
{
//asset has only thumbnail info???
}
Here's what the asset looks like:
You're not seeing, at runtime, every properties on devices because, by default, the (managed) linker is enabled (Link SDK). This will remove any code, including properties, your application is not using (and saves tons of KB and deployment times).
You can try to debug this on the simulator (which default to Don't link) by adding your own assets (in the simulator). Another way is to, temporarily, disable the linker on your device builds.
In either cases your ALAsset
should be showing all documented properties.
Based on @Poupou's help here's the code I added to make it work:
void GotAsset(ALAsset asset)
{
ALAssetRepresentation rep = asset.DefaultRepresentation;
var iref = rep.GetImage();
if(iref!=null)
DoStuffWithUIImage(UIImage.FromImage(iref));
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With