How can a watchface display an image downloaded in the background by makeImageRequest?

The subject really says it all. I'm successfully downloading an image using makeImageRequest in a background process. I believe the image is stored in the graphics pool, and the background process has a reference to it as a Graphics.BitmapReference.

How then can I access this image from the main watchface view?  I can't used Background.exit() to return the BitmapReference since it isn't one of the allowed types for exit(). It should be obvious how to do this, but I can't see how.

Thanks in advance for any help.

Michael

  • makeImageRequest() can return either a BitmapResource, or a BitmapReference. However, in my testing from the background it only returns a BitmapReference, which makes sense since the image is in the graphics pool.

    So the bottom line appears to be that there is no point in calling makeImageRequest() from the background, since you can't do anything with what it returns.

  • Did you call makeImageRequest from the background?

  • I've tested it and there is no data.get() so it means makeImageRequest returns BitmapResource

    Each device returns different bitmaps so you can't use bitmaps from fenix in epix (you have to clear storage when change device in sim).

    You can test it by installing PSX-7 and adding any QR code. If you see downloading message only once it means it is possible to successfully save bmp in storage.

  • I've tested it and there is no data.get() so it means makeImageRequest returns BitmapResource

    I'm not sure exactly what you are testing. Are you saying that you have makeImageRequest() running from a Watchface in the background, and it returns a BitmapResource?

    In my testing I get a BitmapReference.

  • Simple adopt my code.

  • > Simple adopt my code.

    Which code? Are you referring to the three functions that you posted earlier on this thread? If so, are they running in the background called from a Watchface?

  • Yes, I have to in a watchface. As I recall makeImageRequest is sensitive to the parameters.

    I can't post code because it's blocked. But because it's the same code that works in CIQ 3, and because I have a bitmapResource variable in the memory viewer, It seems that in this case it reverted to the old behavior for a watchface background. It sure would be nice if Garmin could confirm.

  • This a code from widget in foreground but now I don't have time to test it in the background and watch face, but I think should run.

  • > This a code from widget in foreground 

    Yes, makeImageRequest() from a widget in the foreground is no problem since you have access to WatchUi. But in the background it is a whole different story. 

  • Why do you need WatchUi in background?