• AVR Freaks

Hot!Harmony v3: Odd Label behavior with a parent Image Plus Widget

Author
KTrenholm
Super Member
  • Total Posts : 783
  • Reward points : 0
  • Joined: 2012/08/08 14:04:23
  • Location: Connecticut, USA
  • Status: offline
2020/01/28 09:52:42 (permalink)
0

Harmony v3: Odd Label behavior with a parent Image Plus Widget

Hi All,
 
I've been working on a project recently (reading and displaying bitmap images from USB to an attached 320x240 display) using a PIC32MZ2064DAG176 and Harmony v3.  MPLAB X Version is 5.30 and XC32 is v2.30.
 
The main goal of reading an image into the internal DDR, converting it to an ImageAsset and placing it on the display via an Image widget works with no issues.  I have a Text Widget as a child of the Image Widget to display the filename of the image when it is displayed.  What I'm looking to do now is replace the Image widget with an Image Plus widget, as this will allow stretch and transform for images that are too large or small than the native res of the display.
 
After replacing Image Widget with an Image Plus Widget, it still "works", images still display, but transitioning between them is sometimes really messy (I uploaded a video here: https://drive.google.com/...YLi0W2fvjE66Ed_3kzD4KM ) This also seems to sometimes clobber my Label widget until the next image is displayed.  I'm having trouble tracking the "why" of this behavior down.
 
I think it might be related to the showing/hiding of the Label widget.  I did notice if I never show the text widget (visible == false), and remove all calls to laWidget_SetVisible() the problems seems to not occur, and the images switch cleanly.  If I set the Label widget to always be shown, the problem seems to happen on the first transition between images, then seemingly never again.
 
I thought maybe that the optimization options for the Label widget in harmony might help (Local Redraw and Force Opaque) since they say they may help unnecessary redrawing of the parent, but enabling them did not seem to do anything.
 
My code for writing the image to the Image Plus widget is just a call to laImagePlusWidget_SetImage().  The label widget then gets updated with the new filename and resized to match the length of the string, and is shown by setting the Visible property of the label with a call to laWidget_SetVisible() after a short delay (not blocking).  Increasing this delay does not seem to help the issue.
 
This all worked pretty cleanly with a standard Image widget, I'm just having a tough time figuring out what's different about the Image Plus widget that might be causing this issue?  If anyone has thoughts, I'd love to hear them.
#1

2 Replies Related Threads

    KTrenholm
    Super Member
    • Total Posts : 783
    • Reward points : 0
    • Joined: 2012/08/08 14:04:23
    • Location: Connecticut, USA
    • Status: offline
    Re: Harmony v3: Odd Label behavior with a parent Image Plus Widget 2020/01/28 09:59:10 (permalink)
    0
    As a side note, the Image Plus widget "Resize to Fit" setting is a little funky, it seems to resize the image to smaller than the display area.  When I give it a 320x240 image for the 320x240 display, it has a small grey border that scales images that should be 1:1 with display resolution.
    #2
    KTrenholm
    Super Member
    • Total Posts : 783
    • Reward points : 0
    • Joined: 2012/08/08 14:04:23
    • Location: Connecticut, USA
    • Status: offline
    Re: Harmony v3: Odd Label behavior with a parent Image Plus Widget 2020/01/28 13:52:27 (permalink)
    0
    So this is interesting:
    I went back to using a standard Image widget and now that I'm looking for it, it exhibits almost the same behavior in terms of rendering the image, it just renders much faster so I wasn't noticing it.
     
    It doesn't clobber my Label sometimes like Image Plus does though.  Possibly a problem with trying to set the visible property of the label before the image has finished rendering?
    #3
    Jump to:
    © 2020 APG vNext Commercial Version 4.5