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.
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
Fully agree, software is not perfect. But sorry, our choosed Operating System does not work as you may expect ...
Embedding all ressources has nothing to do with the later using of ressources. Technically, that's a completely independent and different issue, and mainly done within OS routines and not within your software.
Under Windows, software in general does normally not use ressources directly, it only initialize its usage and displays a given feedback from different OS routines. But the main pozessing is done by external OS prozesses ...
Even you open a given graphic with your favorite software, and your overall visual impression may implify that your software did a good job, sorry, but thas's not really the underlaying technical truth. OS components like GDI, GDI+, graphic-card drivers, graphic-card-rendering engines, and many more, did the real work. And such external components are again dependent on individual user-settings ... that's all nothing you can embedd in any project-file.
We try our best to handle such issues, OS inconsistenzies, even bugs, but many times we also must just accept reality ...
I realize it is an old topic but may help others. I had the same problem as Mathom. Built the display at work and start the same .hmi file up at home and the graphics image has changed. In my case, two images of different sizes overlayed on each other on my home computer.
Fortunately I found this topic and found my office computer (Win7) display text is set for smaller and my home set for medium. The display text determines the DPI of the display where smaller is 96dpi. Changed my home (Win7) display text setting to smaller to match my office and the IDE displays correctly now. This is certainly an issue with the IDE and how it establishes pixel density.
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).