MonoTouch: getting image from ALAssetsLibrary.AssetForUrl

In MonoTouch:

I put the image from the camera in PhotoAlbum:

ALAssetsLibrary library = new ALAssetsLibrary();
library.WriteImageToSavedPhotosAlbum(photo.CGImage, meta, (assetUrl, error) => {
    library.AssetForUrl(assetUrl, GotAsset, FailedGotAsset);
});

Photo everything there works well.

As a delegate, GotAssetI'm trying to display an image, but there is only a Thumbnail. Where is the image?

    void GotAsset(ALAsset asset)
    {
         //asset has only thumbnail info???
    }

Here's what the object looks like:

enter image description here

+5
source share
2 answers

You do not see at runtime all the properties on devices, because the (managed) linker ( Link SDK ) is enabled by default . This will remove any code, including properties, that your application does not use (and saves a lot of KB and deployment time).

( ), ( ). - .

ALAsset .

+4

@Poupou , , :

    void GotAsset(ALAsset asset)
    {
        ALAssetRepresentation rep = asset.DefaultRepresentation;
        var iref = rep.GetImage();
        if(iref!=null)
            DoStuffWithUIImage(UIImage.FromImage(iref));
    }
+1

All Articles