Wrong screen resolution result on IE8 for higher DPI
Jacek
Status: New User - Welcome
Joined: 17 Oct 2009
Posts: 1
Reply Quote
Hi,

Many thanks for your script!

Your computer box script reads wrong my computer's screen resolution on IE8 on Vista. The resolution read with Nivida controll panel is 1280x800 and the script reads 1024x640. I changed the 'width' part of the function client_data(info) like this:
if (info == 'width'){
width_height_html = '<h4 class="right-bar">Current Screen Resolution</h4>';
width = (screen.width) ? screen.width:'';
height = (screen.height) ? screen.height:'';
if (typeof(screen.deviceXDPI) == 'number') {
width *= screen.deviceXDPI/screen.logicalXDPI;
height *= screen.deviceYDPI/screen.logicalYDPI;
}
;
width_height_html += '<p class="right-bar">' + width + " x " + height + " pixels</p>";
(width && height) ? document.write(width_height_html):'';
}

and everything works fine.

I had to add this snippet to the script because on IE8, on computers which's screen DPI is 120, my flash panoramas viewer window was artificially enlarged, in conflict with my original design. IE8 revealed the parts of the flash canvas, which are normally screened off.

I found some explanation of the bacground at the url
msdn.microsoft.com/en-us/library/ms533721%28VS.85%29.aspx

but it was after I achieved my goal.
The modified script working page is here:
eurofresh.se/test/sejm/info3.php
I could not test the script on different browsers/OS but the changes should not impact them, I hope.
Best regards
Jacek
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4124
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
nice information, thanks.

I'll test that at some point then add it.

By the way, it looks like your computer information script is running with the old php browser detection script, those have to be resynced because I changed a few small things in both scripts to make them more future compatible.

Check the your computer info script current and the php browser detection current for changes. The new versions of either are not fully compatible with the older versions of the other.

Generally I try to avoid such changes but in this case there was no way around it, I'd used a bad method in the computer info script that makes it fail if php browser detection is updated, that is now fixed, along with mobile handling to some crude form.

<update>added this support to script.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours