Long images are shortened

Why can’t long images, longer or wider than the screen, be incorporated without shrinking. They are 1 kbyte images.
Why is this happening? How is it solved?

Far too vague. Please include a code example.

Code? It is not a code problem. Image is 500 mm. long x 1.7 mm. high at 150 ppi resolution.
It is inserted with newImage, as always. It is not a code problem. The image is scaled. Being smaller.

Images are in pixels not mm. Post your code if you want help.

The unit that one takes as a reference is a function of the context and the type of application that one is developing: they can be inches, mm, cm, spades, points, pixels, etc. That has no relevance in posing the problem. Nor is the code relevant. It is not a problem of code or units. The information provided is sufficient and sufficient to evaluate the problem and make a simulation of it. There are the dimensions of the image, its resolution and what happens on the screen when loading it with the newImage API. Needless to say, the image is in PNG format.

As someone who does a lot of graphic design, I just want to point out that when you are working with digital images, then the only thing that matters is pixel dimensions. DPI/PPI only matters when you are looking to print your images.

In your particular case, if you have a 500mm x 1.7mm image at 150ppi, it means that you have an image that is 2953 x 10 pixels in size. If these aren’t your image’s dimensions, then your aforementioned pixels per inch value is incorrect.


The reason why seeing code is important is because if your problem is that your image is smaller than it should be, then it’s either because 1) your image is smaller than you think it is, 2) your config.lua settings and Solar2D’s automatic scaling that comes with it, or 3) you are applying your own scaling to your images.

If you’ve just loaded the image using display.newImage(), then your image isn’t scaled by that function, but it is likely scaled by your config.lua (or some other code). For instance, you may have a content area of 3840x2160, so the image doesn’t cover the entire screen, and then you view it on a 480x320 simulated iOS device, so it gets resized even more.

So, like SGS said, you need to provide more information. You have a visual problem that could be caused by any number of things and without seeing any code, all anyone can do is guess.

1 Like

Make a tiny example that demonstrates the problem. Zip it up. Attach it to the post.

That way we’re not guessing at the issue.

Tell us what simulated device/resolution you’re testing at too.

1 Like