Start a new topic
Solved

Nextion editor HMI images wrong when opening on other PC

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.


Sample file:

https://github.com/mathompl/AquaLed/raw/master/Nextion/nextion-demo-en.HMI


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.

HMI

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 ...


best regards


Gerry

I'll check DPI, but tried to open the file on 3 computers with same results. Why would display DPI settings even matter when importing files into Nextion editor ?

 

is system DPI setting used by nextion editor on images import ?

 

Hello mathom,


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).




also a side note in general. Imported graphics should never exceed the set and used display size. The editor will probably import and convert this graphic in its full size, but results on further loading can be unforseeable and interesting ...

Gerry

 


 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.

Images resolution should be exact - I agree, but in my project some are, and some are icons like 20x20px, so read prev post.

 

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


I wouldn't call this an editor-bug. Just think about the underlaying process how the editor works.

When opening a new HMI, this HMI is fixed to a given display type. When you furthermore import a graphic, the import is done based on the momentary existing settings of your used PC. And exactly this is saved in the HMI.
When you later open the HMI on another PC with other conditions, the HMI with its embedded Object settings just don't fit ...

Not to forget, the graphics are maybe NOT available on your target PC, so when you just load the HMI, it will be in every case messed, because the embedded and already converted HMI graphics must be upscaled to fit the new DPI settings ... that's nothing which can be handled within the editor itself. We surely can upscale a HMI embedded graphic, BUT if the scaled result will again fit users expectancy or even come close to its origin ... I have my doubts ...

Gerry


Yes maybe, but IMHO - HMI files should be neutral.

 

Let me make an example ...

Just imagine MS-Word. You spend a few hours and you design a nifty outlooking menue-card, using some real great looking fonts ...
After finish, you save the DOC and send the saved DOC to your customer. He opens the DOC and see only a big mess and start complain. Why?
Because on his PC are the fonts you used just missing. And Word replace the missing automatically with own suggestions. And so, the whole design is away ...
Would we call this a bug, or even blame Micrsoft to fix this in the next Word version? Who's fault is it?

- Yours, because you used too special fonts?
- Your customers, because he does not have your used fonts installed?
- Words, because Word can't handle this?
- Microsofts, because MS couldn't foresee, which fonts a given user may use?
- Microsofts, because MS couldn't foresee, which additional fonts a given user may have installed?

A DOC is not only a plain ASCII text format, it contains data and meta-data. BUT it does not contain all used components and settings of your origin PC. And so does HMI ...
Login or Signup to post a comment