AsPNG and AsJPEG methods on UIImage Class fail

StephensinclairStephensinclair USMember ✭✭

Hi All,
Trying to save an image a preview for a video. When the video is done persisting, I call this method to get a preview thumbnail image of the image:

  notification = MPMoviePlayerController.Notifications.ObserveThumbnailImageRequestDidFinish ((sender, args) => {
                    var imgJpg =args.Image.AsPNG();  // *** FAILS HERE

I get the "Cannot cast from source type to destination type." for both. No idea how to save this to disk. Need a workaround since this seems like a bug.

Any ideas?


  • adamkempadamkemp USInsider, Developer Group Leader mod

    Try a clean build. I've seen that before, and reported it as a bug, but it's really difficult to reproduce. If you can reproduce it every time even after a clean build then try to make a small example and report a bug (or just post it here, and I'll create the bug report).

  • StephensinclairStephensinclair USMember ✭✭


    I did a Clean All and Rebuild All and it worked. Looks to be working ok now.

    Thanks for the response, that one was hard to find!


Sign In or Register to comment.