Issue Nextion function picq

Hi,

Trying to work with Nextion and playing with picture manipulation.
When using picq function I get an error stating: Error:Invalid Variables:picq 50, 500,150,150, 1

There are no variables used in this function.
What am I doing wrong?

See all in this screen shot:

Gr,
Ron

picq 50,500,150,150,1

If you have a 480x320 display then the 500 value is out of range.

From the Nextion Instruction Set
https://wiki.iteadstudio.com/Nextion_Instruction_Set#picq:_Crop_picture

picq: Crop picture

picq x, y, w, h, picid

x: x coordinate starting point;

y: y coordinate starting point;

w: area width;

h: area height;

picid: Picture ID;

  • Example:

picq 20, 50, 30, 20, 0 //Crop the area from starting coordinate (20, 50) , with a width 30×height 20 size, //in the picture 0 (the background picture must be full-screen) and display it on //the screen, and the display coordinate is the starting coordinate (20, 50).

Remarks:

This instruction requires that the background picture must be full-screen; otherwise, the image you crop is not the one you want. The crop image area and the display area is overlap on the screen.

Hi,

When changing the 500 to 50 (was a typo in the picture I tried to make for this topic) it still shows the same error.

You are cropping picture id 1 but the pic for the page is shown as pic 0. What if you change the crop instruction picq to 50,50,150,150,0 .

I get the same message.

Idea is to have a base picture as background and having a cropped picture partly over it.
This is just an unusefull test just to see it working.

In the end there will be progress elements like in this example:

picq example

Try with the picq instruction as a PostInitialization event instead of a PreInitialization event.

In my experimenting with picq I have gotten the croped image to display properly as a post, touch, or release event but not as a PreInitialization event.

Hi Cattledog,

Thanks for having patience with me.

I tried to put the picq in those events and still the same erre.
What is not clear to me is the message talks about variables in the statement where I only use numbers.

I just did a test with only having one page in the HMI file and two pictures. The same error message.
I have seen examples on the internet where this works: two full screen picts using picq to overlay a part of one over the background pic.

I think I found the issue: spaces in the picq command after the "," separators (like usual to do when programming for reading).
Aftre removing those and putting the statement in the post initialization it worked.