Complete
over 2 years ago

WERETECH-12048

Fix will be applied to next SDK release.

Devices affected will have firmware updates in a future firmware build.

No more transparency for font background on bufferd bitmap since SDK 4.0

Hi, 

I use a bufferedBitmap with color palette and custom bitmap fonts without antialiasing.

Since SDK 4.0 the font background  is not more transparent. The color is defined before:

dc.setColor(CustomColor, gfx.COLOR_TRANSPARENT);
   

The code is running many years without problem.

I don't understand, what's going wrong with new SDK

Parents
  • Hi Travis,

    this problem occurs only on devices which not support the new createBufferedBitmap, fenix 6 and older and only with defined palette for bufferedBitmap.

    On a Vivoactive4 I don’t see this, but this device have enough memory to use a full palette for bufferedBitmap. Therefore I have not test the transparent font background on this device.

Comment
  • Hi Travis,

    this problem occurs only on devices which not support the new createBufferedBitmap, fenix 6 and older and only with defined palette for bufferedBitmap.

    On a Vivoactive4 I don’t see this, but this device have enough memory to use a full palette for bufferedBitmap. Therefore I have not test the transparent font background on this device.

Children
  • To reproduce this sample is a little bit complex. But I have another sample, it is simple

    The digital time with this look is created with a dseg7 font, which is printed in white and then with offset 1px in black.

    This is only working with a transparent font background. For the always on second hand is a buffered bitmap created with palette.

                if (offscreenBuffer == null) {
                	offscreenBuffer = new Gfx.BufferedBitmap({
                    :width=> VA_Width-12,
                    :height=>VA_Height-12,
                    :palette=> [ProfileColors[0], ProfileColors[1], ProfileColors[2], ProfileColors[3], 
                    			ProfileColors[8], ProfileColors[7], ProfileColors[9], Gfx.COLOR_GREEN,
                    			CustomColorHands, CustomColorHandsShadow, DigColor, DigColorShadow]
               	 	});
    
                	targetDc = offscreenBuffer.getDc();
                	
                }

    The colors are defined with different color profiles

    And this print the digitaltime string:

     

            if (DigitalTimeType == 3 && !ClassicHands && HideElements == 0) {  // some conditions to draw shadow 
            	dc.setColor(DigColorShadow, Gfx.COLOR_TRANSPARENT);
            	dc.drawText(X-1, Y-1, fontDseg7, timeString, Gfx.TEXT_JUSTIFY_CENTER);
            }
            dc.setColor(HideElements > 1? ProfileColors[1] : DigColor, Gfx.COLOR_TRANSPARENT);
            dc.drawText(X , Y, fontDseg7, timeString, Gfx.TEXT_JUSTIFY_CENTER);

    Have you a question, please give me a hint

    best regards

  • Hi, would you be able to share an example of the problem code? I can understand you may not want to share your entire project, but a code snippet involving the creation of the bufferedbitmap would be very helpful. 

  • I have one watch face online, which is based on a transparent font background. It is AnalogSwitch Sports. With SDK 3.2 it shows normaly on a VA3 or fenix5/6:

    to safe energy the static elements are only write on watch face start or change settings to a buffered bitmap with palette of some colors. The right half circle is based not on a complete bitmap, then I can't change the color with settings, it is based on a custom font with all tiles of this half circle. So I can draw the buffered bitmap every minute and don't create the picture from tiles every minute.

    This is working since many years.

    With SDK 4.x it shows now:

    All tiles have loose the transparent background. I can't update the watchface anymore to support more new devices.

    thanks 2aCD