Simulator skins and real device size/dpi for screenshots

59 views
Skip to first unread message

P5music

unread,
Apr 6, 2021, 3:14:36 PM4/6/21
to CodenameOne Discussions
Being that at present time it would be very difficult for me to use the maven feature, and also I do not read anything about running on iOS simulator on the new maven guides,

I am trying to just put the screenshots of my app's user interface inside the apple devices "frames" that I will take screenshots of in the iOS simulator (OSX).
We know that the CN IDE simulator has issues with dpi and the CEF BrowserComponent, also I see that the device screen is resizable, it can be even huge or tiny. 
The CEF BC stays with the same dpi, so just the amount of the displayed HTML changes if I resize the simulator, it is not resized, just its "viewport" changes.

I would like to know if it is possible to know which size of the simulator windows (for a certain skin) is what corresponds to the real device screen size (with the given BC "dpi-inside-simulator" that is fixed) 
so to make screenshots of the real user interface that will fit perfectly inside the apple devices "frame".

Thanks in advance 

Shai Almog

unread,
Apr 6, 2021, 9:47:39 PM4/6/21
to CodenameOne Discussions
The size is identical. If you use the screenshot feature (without skin) you'll get a size that should correspond to the device resolution.

Dave Dyer

unread,
Apr 7, 2021, 6:16:34 PM4/7/21
to CodenameOne Discussions
Apple doesn't require actual screen shots, as long as they are reasonably
representative and don't obviously originate from a non-apple device.
So take a real screen shot and photoshop it to the required sizes.

P5music

unread,
Apr 8, 2021, 2:19:48 AM4/8/21
to CodenameOne Discussions
@Shai
According to what you say it is possible to have real size screeshots. It is good.
But there is a problem. I asked about the size of the simulator window because I have to match the real HTML appearance at that size.
The BC always displays the same dpi, so I have to create a screenshot that uses 
the real size
and
the real dpi for BC.
I do not know how to explain better.
Regards

@Dave
I think that, being easy to have screenshots at real screen size,
it is better not to scale images so to have the best non-aliased or not-pixelled images.
I will use the frames that can be downloaded from Apple developer site, there are ones that correspond to each device, then I will use them to frame my real size screenshots.
Regards

Shai Almog

unread,
Apr 8, 2021, 11:16:21 PM4/8/21
to CodenameOne Discussions
That would be a problem. Native widgets generally act differently on devices. That's just the way they work by definition.
Message has been deleted

P5music

unread,
Apr 9, 2021, 2:41:08 AM4/9/21
to CodenameOne Discussions
Ok, that's just the original problem, as I wrote in the first message. We got there.
Indeed the question is very relevant about just that. It's why I asked it.

Is it somehow possible to have information about the pixel size of the simulator screen  when displayed on the computer screen?
I mean, in real computer-screen pixel size
so to be able to have a real screenshot?

As I understand the only way is to measure the pixels on the computer screen.
If I am lucky some devices have less pixels of my computer screen, but I already know that it is not the case.

Would be it possible to have a new option on the simulator that 
set the size at real pixel size?
It is technically possible because it is just as the user resized manually.
I know that the simulator would become a giant window in some cases, but it is just necessary for the moment of taking the screenshot.
The only caveat is to make it have the top-left corner in the top-left corner of the screen so the menu is accessible.
It could be done with just some lines of code, and it would be very useful for developers that have the BC in the layout, to make official screenshots.
Regards

Shai Almog

unread,
Apr 10, 2021, 12:18:41 AM4/10/21
to CodenameOne Discussions

P5music

unread,
Apr 10, 2021, 2:34:56 AM4/10/21
to CodenameOne Discussions
Unfortunately I think that at zoom size pixels maybe right but the CEF BrowserComponent is not rendered with the real dpi.
Indeed I have some metrics inside the displayed HTML that show me that 1cm inside the BC does not corresponds to 1cm outside.
It happens for iPhoneX for instance. It may depend on the dpi factor, like the retina screen, I don't know.
I could reduce the size until I have the correspondence, but it is very awkward and it would yield approximate image size.
Regards
Reply all
Reply to author
Forward
0 new messages