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 Comment 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