Ticket Created
over 3 years ago

CIQQA-855

Rendering text with a transparent background in a BufferedBitmap that has a palette.

Because Garmin does not want to take into consideration the questions asked in the discussion thread "Is there a reason why Graphics.COLOR_TRANSPARENT does not match the background?"

https://forums.garmin.com/developer/connect-iq/f/discussion/273684/is-there-a-reason-why-graphics-color_transparent-does-not-match-the-background/

I open this topic.
The crux of the problem:

1. The problem manifests itself only in a simulated one, on a real watch it works as it should.

2. I create BufferedBitmap to full size of the screen - I will draw on it. Including non-aliased fonts.

3. Then I display this BufferedBitmap on the screen. When drawing the second hand, I again bring out the entire buffer, the limited area where the second hand was - to erase the second hand.

4. In the simulator, the inscriptions are displayed on a white background, despite the fact that I painted them with a transparent background.

function onUpdate(dc) {
....
dcOffscreenBuffer = new Gfx.BufferedBitmap({
    :width=>(center)*2,
    :height=>(center)*2,
        :palette=> [
        BGC,
        0x000000,
        0x555555,
        0xaaaaaa,
        0xffffff,
        LC,
        AC,
        DC,
    ]
});

var tdc = dcOffscreenBuffer.getDc();

.....
if (cIcon!=' ') {
    tdc.setColor(AC, -1);
    tdc.drawText(center-d*5*k, 170*k-s, iFont, cIcon, a);
}
tdc.setColor(LC, -1);
tdc.drawText(center-d*25*k, 170*k-s, label, v, a);
.....
dc.drawBitmap(0, 0, dcOffscreenBuffer);
.....
} // onUpdate(dc)

Also, some developers have this problem on real devices: Venu2 and Fr945LTE