I have problems with Nextion Editor imagesp. It works fine on one computer, but when I transfer HMI file to another, all images dimensions are wrong and this also includes background.
When I delete all images and add them again on the new computer everything is ok.
and sample attached.
it seems like nextion editor keeps images data somewhere on the PC and when one opens HMI file on other computer, all images are wrong. Please fix it.
what comes to mind first, did you check your screen DPI settings of your used PC? Normall is 96 DPI, but on todays high-end screens with high-end graphic cards this DPI setting can also be much higher.
This also would explain, when just copy to target PC the HMI corrupt, when recreate on target PC all ok ...
Please may you check for this?
When it is correct after build, but wrong after a copy, it is morelike an issue of the used PC settings rather then an Editor issue ...
All picture and font resources are kept within the HMI and TFT files and as such could be deleted from the hard drive as soon as included in the HMI project.
What I do notice from your HMI is that the settings you have in the github version as set for a specific model
This model is defined in the settings tab. In this case the NX3224T028_011 basic model which is a 240x320 2.8" device.
In your HMI I see some images for 800x600. If working between different model sizes for the HMI, you will need two HMI files, one for each.
The numbers could be changing especially if deleting them all and putting them in again.
The other way to change the image numbers is with the up/down arrows in the picture panel.
If you have 2 model sizes using the same nextion-demo-en.HMI file in your github, this could certainly cause grief
You will need to have separate files for each model.
But the editor itself saves the images when it is added to the project - it does not reorder them without having been told to do so.
I dont change device models. Just opening the file on other computer with same nextion device selected yields wrong images resolutions. Deleting all images and adding them again on said computer resolves the problem. But when people download the HMI file and open it - all images sizes are wrong.
The Nextion devices do not use DPI but use pixels. So if you have a 240x320 device you should modify the image file to be 240x320.
The Nextion editor when it imports a file will convert it to 565 16-bit color format, but it does not resize or crop the image for you.
In this manner, importing an 800x600 picture into a 240x320 device will store the entire 800x600 picture in the new 565 color format.
You will need to crop and resize your images before importing into your project where your project is set for a specific size.
If people are downloading and the image sizes are wrong for them, you will need to create a project for their size.
If any of them are updating their project to your github, this could explain the behaviour you describe (changes without knowing).
OK, checked. The problem IS DPI related and this is a bug. HMI files saved on different DPI settings are opened erronously on other DPI settings. Reloading files fixes the problem so it definitely is a bug in importing/converting files in Nextion editor - the resolution is not neutral. Or mayby the problem lies in graphical interface of nextion editor - in preview painting window. IDK. Problem is easily replicable. Just change PC DPI and open any file.
DPI should be converted into pixels and resized from there.
It is the requirements that the image is imported in pixels not to exceed the resolution of the device.
Therefore 240x320 device requires max picture size in pixels of 240x320. Using DPI will not change this requirement.
It is the expected behaviour that a higher DPI will cause error. The Nextion Editor does not have functions to handle DPI