White flash between page change

Hi.

I have a 3.5" basic Nextion LCD, loaded with 6 pages (one image only on every page), and a timer to change page every 800ms.

When pages change from 0 to 1, 1 to 2 etc there is a white flash. But from page 5 to page 0 the transition is absolute fine with no flash.

Can I do something about it please?
Ioannis

This could be related to your page preinit event code. Are you doing anything there?

Kind regards,
Max

Thanks Max.
No. There is nothing else except the tmr on every page and the event page pagex to change pages.

The curious thing is that rolling over from the last to first page goes smooth. It does the flash between the pages like it needs some time to load the new page. And is very annoying…
Ioannis

There is one scenario which could explain the flicker:
You wrote “one image only on every page”. Are these images in a full screen picture component? If yes, flicker would be normal because the Nextion loads the page with its default background color (white?) first, and then only the picture component.
To prevent this, remove the picture component and place the respective image directly as the page background of each page. Then, there will be no more flicker.

2 Likes

Thanks Fjador.

This did the trick! Never could thought of that!
But does not explain why on rolling over it works OK but not in the rest of the pages.

Ioannis

Theory is when you know everything and nothing works. :nerd_face:
Practice is when everything works and you don’t know why. :slight_smile:

Glad I could help.

1 Like

You did help a lot!
With your extended practice I guess! I do have a lot of question regarding Nextion as I am really novice. But prefer to try first myself.
Thanks again!

My best wishes for a happy and prosperous new year to all.

I tried a lot but cannot understand how on earth can this be done. When user touches say King button, the King from the library be shown in the red arrow area.

Thanks,
Ioannis

Use the ‘xpic’ command to overlay the king image on the board image.

In cases like this one I‘d suggest to simply use page0.pic=1 (obviously using the pagename of your page).
xpic works, too, but it is a more difficult solution with a few drawbacks (like that it‘s not a persistent change; any page refresh kills it f.ex.). It has its place for sure I just can’t see the justification here.

Kind regards,
Max

Thank you both for the reply.
Ioannis

xpic would seem to be the appropriate solution here because he’s looking for something that would appear to place a user selected chess piece at a particular position on a persistent image of a chess board. “xpic” allows for overlaying the image of a specific chess piece onto the static chess board without this overlay being persistent (no redrawing the chess board required to remove or change the chess piece overlay, simply refresh ‘ref’ to clear the xpic drawn piece)

To use pageX.pic= would basically require redrawing the underlying chess board image on every update.

I suppose you could make individual images of each chess piece+color all with the same dimensions and place a picture object at that point on the page then use p0.pic= to change the displayed piece and ‘vis’ to hide/show the piece at the pre-determined screen coordinates. Picture images can’t be moved or repositioned thought (except on Intelligent series) while ‘xpic’ would allow for positioning any chess piece image at any board/screen position on the fly (basically moving or repositioning pieces at runtime like an actual chess game). 'xpic" would also allow for more flexibility in chess piece image sizes by allowing for a single picture that contains every chess piece display variant and each individual piece to be essentially “clipped” from this master image and copied onto the chess board (no restrictions on individual piece dimensions either).

Xpic really does seem to be the ideal solution here.

For realistic placement of individual pieces I might even include scaled versions of each individual piece in the master image to allow for 3D depth on the chess board. You basically scan through the currently placed board pieces from deepest depth and move back one row at a time with the images of pieces nearest to the viewer appearing larger and correctly obscuring any board pieces positioned deeper on the board. To clear or move a previously placed piece simply use ‘xpic’ and clip the only the necessary square from the chess board image and place it over the position needing to appear cleared.

As I am new to Nextion, it seems a bit complicated. I will experiment and see how it goes. In the mean time I tried to overlay a new crop image over the background, and this seems OK, with no flickering or other effects. I do not know if this consumes more memory though.

Thank you,
Ioannis