Announcement

Collapse
No announcement yet.

Corrupted Image with a duplicate of its side pixels.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Corrupted Image with a duplicate of its side pixels.

    Hi,

    On uLCD43-PT (Picaso). I have an image that is framed (it is a button but not managed as a button in the Picaso API)
    My functions managing this image are the same as other "button" images in the form.

    Somewhere, it generates a vertical line, 1 or 2 pixels to the right of the left side, like a duplicate of 1 pixel wide of the image border of either vertical boundaries.

    It is maybe related to the following API functions used for feedbacking these images when :

    gfx_Clipping(ON);
    gfx_ClipWindow(x,y,x+ img_GetWord(hndl,image,IMAGE_WIDTH),y+ img_GetWord(hndl,image,IMAGE_HEIGHT));
    gfx_ChangeColour(BLACK,color); pause(100);
    gfx_ChangeColour(color,BLACK); gfx_Clipping(OFF);

    I have problem tracing the problem because putting my trace function trace(123); (sending that number to the serial) call generates an overflow error 15 when put there, but not somewhere else.

    The other weird thing is that clicking another button image, sometimes generates that line in always the same problematic button image, not the one clicked on.

    I suppose it could come from gfx_ChangeColour.

    Sounds a bell?

    Thanks,
    Marc
    Attached Files

  • #2
    Not sure exactly, but shouldn't you be saying
    gfx_ClipWindow(x,y,x+ img_GetWord(hndl,image,IMAGE_WIDTH)-1,y+ img_GetWord(hndl,image,IMAGE_HEIGHT)-1);

    The error 15 must mean you are close to the stack size limit, you may been to increase it with the #STACK directive.
    Mark

    Comment


    • #3
      Thanks, Any idea about the default hidden value and how we can know the actual remaining value?

      Is it written in a memory address that we could read?

      Thanks,
      Marc

      Comment


      • #4
        Ya, I previously corrected the -1 so the halo disapeared. But do you want to say that this function could work weird if we work larger than an image, or as I expected, no difference because it is working on the screen content memory?

        Comment


        • #5
          The 'hidden' stuff regarding stack size and usage?
          Code:
           #platform "uLCD-32PTU"
            #STACK 100
            #inherit "4DGL_16bitColours.fnc"
          var i ;
            func recurs()
              i++ ;
              print(i, " ", EVE_SP(), "x", EVE_SSIZE(), "\n") ;
              pause(1000) ;
              recurs() ;
          endfunc
            func main()
                gfx_ScreenMode(PORTRAIT) ; // change manually if orientation change
             print("Start ", EVE_SP(), "x", EVE_SSIZE(), "\n") ;
              recurs() ;
                repeat                      // maybe replace
              forever                     // this as well
            endfunc
          Mark

          Comment

          Working...
          X