Thursday, June 16, 2011

Fun With Aspect Ratios & Resolution

I'm not sure what it says about a person if this seems fun, but today I worked on improving some of our internal scripts that allow our support staff to remote control end users. :) This was a project brought about because of a desire for increased tablet usage. One caveat of that process is dissimilar resolutions when using VNC. Some of the users have higher resolution and some work in portrait mode and vncviewer would open 1:1 in the resolution on the remote site. This created scroll bars that had to be navigated, and the user would move things around and not realize you couldn't see their whole screen.

So as part of the iPad remote control project, I came up with some additions to the ksh code that checks resolutions on both sides and then always ensures that their screen fully fits on yours. This code is used in both areas: support to remote control end users and also to remote control your desktop session from any device. These shots show the results:

Desktop user (1440x900) is remote controlling an end user who is in portrait mode (1024x1280):

iPad (1024x768) is remote controlling a portrait thin client (1024x1280):

iPad (1024x768) is remote controlling a landscape thin client (1440x900):

The code is really very simple, get the height and width of both devices and figure out the aspect ratios. Then use that to figure out if it's best to use the width or height as your baseline, subtract a few pixels for window manager and lower panel, and calculate the other value based on the aspect ratio.

Fun stuff, and useful for the rest of our staff. It's already live and I should get feedback tomorrow.

No comments: