checkerboard for AOD display I made

Hey, I followed  great idea for AOD display- 

https://forums.garmin.com/developer/connect-iq/f/discussion/192673/how-to-enable-an-always-on-mode-for-venu-amoled?pifragment-702=1#1252269

in the Venu series and I believe I might have taken it step ahead:

I used my Photoshop knowledge to create a pattern with 2 white pixels for every black pixel and it looks like this (this is a 6x6 pixels screen and everything besides the big black squares is empty)

Then I used this pattern for 360x360 pixels screen (Venu 2s), 390x390 pixels screen (Venu 1) and 416x416 pixels screen (Venu 2).

Here are their PNGs and I hope those will be useful for you:

https://drive.google.com/drive/folders/1yc3bj-8G3ygPCDUCdY4VA55uJ753fZhP?usp=sharing

Here is how to use it (most of this code is 's code and I just added mine   

class MyView extends WatchUi.WatchFace {

	var inLowPower=false;
	var canBurnIn=false;
	var AOD;
	
    function initialize() {
        WatchFace.initialize();

        if(Sys.getDeviceSettings() has :requiresBurnInProtection) {       
        	canBurnIn=Sys.getDeviceSettings().requiresBurnInProtection;        	
        }
    }
    
    function onUpdate(dc) {
        if(inLowPower && canBurnIn) {
            //do AOD display (<10%. 3 minutes max)
            dc.setColor(0, 0);
		var y=clockTime.min%3;
		AOD= WatchUi.loadResource(Rez.Drawables.AOD);
		dc.drawBitmap(0, y, AOD);
        } else {
            // regular display
        }
    }
    
    function onExitSleep() {
    	inLowPower=false;
    	WatchUi.requestUpdate();
    }

    function onEnterSleep() {
    	inLowPower=true;
    	WatchUi.requestUpdate();    
    }
}

I hope I can be helpful for this forum after so much help I got here.

BTW: I know it takes a bit of memory for this but since it's Venu series I believe that memory isn't the problem.

  • Could you please tell me how you set your fnt, I did it like this but it doas not seem to work...

    it is like 1pixel width. my png is a 420x420 checkboard.

    info face="ESSAI" size=420 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=0 aa=0 padding=0,0,0,0 spacing=0,0 outline=0
    common lineHeight=420 base=420 scaleW=420 scaleH=420 pages=1 packed=0 alphaChnl=1 redChnl=0 greenChnl=0 blueChnl=0
    page id=0 file="ESSAI_0.png"
    chars count=1
    char id=65   x=0     y=0     width=420    height=420    xoffset=0    yoffset=0     xadvance=0    page=0  chnl=15

  • info face="Laila Semibold" size=152 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 outline=0
    common lineHeight=152 base=108 scaleW=256 scaleH=256 pages=1 packed=0 alphaChnl=1 redChnl=0 greenChnl=0 blueChnl=0
    page id=0 file="cb152_0.png"
    chars count=1
    char id=49 x=0 y=0 width=50 height=152 xoffset=0 yoffset=0 xadvance=50 page=0 chnl=15

  • I was curious as to which would be best for drawing the checkerboard:  Font or Bitmap.

    So I ran some tests in the simulator (for an epix2 - different on other devices??).

    1) The first test uses the same bitmap code above - that is, it loads the bitmap resource in onUpdate()

    2) Second test uses the bitmap code but loads the resource in onLayout() (surely, this is where you'd do it, or maybe initialize())

    3) Third test Uses a 30X30 font in a nested for loop to output enough fonts to cover the screen.  font resource is loaded in onLayout()

    Average Timings observed over  1 minute of operation, as follows:

    1) 17.90ms

    2) 17.51ms

    3) 24.82ms

    Bitmap drawing (loading resource in onLayout() - result 2) appears to be the winner in this case AND on the newer devices/firmware you don't have to worry about memory usage too much for this bitmap as it goes into the graphics pool.

  • For #3, the custom font is also in the graphics pool, and the timw will vary pased on how you draw it.  I use a sinngle drawText with 5 characters to do a 250x152 checkerboard.

  • It's a good point Jim.  I'll need to try a larger font.  I did try removing my inner FOR loop, replacing it with a drawtext of one complete line of my font (ie, "aaaaaaaaaaaaaa"), but that only clawed back ½ a ms.  Bitmap, as per above, still appears quicker...

  • Thanks for reporting this. I’d like to do some additional tests…

    Probably a silly question but how did you measure the timing? Is there a profiler in the simulator, or are you using println statements?

  • System.getTimer() can be used, but it's inaccurate in the sim, and it can also vary by device.  There is a profiler in the 4.1.0-beta1 SDK, but I've not looked ate how accurate the times are there.

    Also keep in mind we are talking the matter of a few ms for something that only happens once a minute in low power mode.

  • Hi 

    Is it  possible to have same png

    for 242x242

    362x362

    392x392

    and 418x418

    When a pixel if in position 0 pixel is burned.

    I will start from -2 to 0  

    dc.drawBitmap(moduloAmoled, 0, AOD);

    Thanks for your 4 files.

    Didier