Ticket Created
over 3 years ago

CIQQA-607

Bug: IconMenuItem not working with Graphics.BitmapType

According to the docs, the IconMenuItem requires an icon as Graphics.BitmapType or WatchUi.Drawable

So, I tried to download an image (100x100) using makeImageRequest. This returns a WatchUi.BitmapResource. As Graphics.BitmapType is a typedef for multiple types, the WatchUi.BitmapResource is one of them, so I would expect I can throw this in directly in the constructor for IconMenuItem. Unfortunately, the following Error is thrown:

Error: Unhandled Exception
Exception: UnexpectedTypeException: Unexpected icon type, expected Drawable
Stack:
  - setIcon() at C:\grmn\prj\DI\toolchain\mbsimulator\submodules\technology\monkeybrains\virtual-machine\api\WatchUi.mb:3361 0x30003b4c
  - initialize() at C:\grmn\prj\DI\toolchain\mbsimulator\submodules\technology\monkeybrains\virtual-machine\api\WatchUi.mb:3344 0x30003ac9
 

How can this be solved? I already tried to use BufferedBitmap, but the error is still there. Also Graphics.createBufferedBitmap() is not found.

Using: Connect IQ Device Simulator 4.0.5, Eclipse completely updated. Latest SDK from SDK manger.

Parents Comment Children
  • The workaoround you show is loading an Icon from the Rez Module. The workaround is not possible for BitmapType's that are e.g. downloaded or retrieved through other means, since they do not have a Resource Id (rezId).