Hi,
I'm adding v4 support to my app to support the Venu2 and I have it working but had to change the code given in the example in the docs:
Should the first line in the code example read:
Graphics.createBufferedBitmap(options).get();Because the return value from the function seems to be bufferedbitmapreference, which doesn't have the getDc() method. I need to call get() first.
Is this a typo or am I misunderstanding how it should work? Also, as an aside if that's right, it would be great to have that get() method documented in the sdk docs and the example code added there too as it took me a while to find it.
Example:
import Toybox.Graphics;
//! Factory function to create buffered bitmap
function bufferedBitmapFactory(options as {
:width as Number,
:height as Number,
:palette as Array<ColorType>,
:colorDepth as Number,
:bitmapResource as WatchUi.BitmapResource
}) as BufferedBitmapReference or BufferedBitmap {
if (Graphics has :createBufferedBitmap) {
return Graphics.createBufferedBitmap(options);
} else {
return new Graphics.BufferedBitmap(options);
}
}