472,358 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,358 software developers and data experts.

Getting current screen resolution

This is a "thing" that has been annoying me all morning: and I can't
work out how to do it.

I need a way to get the DPI or screen resolution of the monitor that a
script is currently runnign on.

I have a way in Windows but it doesnt port to Unix (which is important).

Any ideas?

--
Thomas Morton

Lead Developer || Founder
TomNRob Web Services
www.tomnrob.com
Jun 27 '08 #1
3 3182
Hello,
This is a "thing" that has been annoying me all morning: and I can't
work out how to do it.

I need a way to get the DPI or screen resolution of the monitor that a
script is currently runnign on.

I have a way in Windows but it doesnt port to Unix (which is important).

Any ideas?
Maybe one of Tkinter.Tk winfo_* methods?

HTH,
--
Miki <mi*********@gmail.com>
http://pythonwise.blogspot.com
Jun 27 '08 #2
Thomas Morton wrote:
This is a "thing" that has been annoying me all morning: and I can't
work out how to do it.

I need a way to get the DPI or screen resolution of the monitor that a
script is currently runnign on.

I have a way in Windows but it doesnt port to Unix (which is important).

Any ideas?
warning - be very careful about trying to come up with something like this.
Today it is common for people to have more than one monitor, so you will need to
take that into account. Just getting resolution of one monitor might not be
enough (but then I don't know EXACTLY what is is that you are doing with the
resolution). I see a lot of software that ignores the dual-monitor possibility.

-Larry
Jun 27 '08 #3

Yeh that's not such an issue - this is for some basic image analysis for a
document / report. It's not HUGELY important data (it can be wrong with no
real come back) but it has to be roughly accurate...

The idea is I have an image and I need to work out how big it displays on
the monitor of the computer running the script :)

Thanks for the replies so far ppl :) I think I might have it.......

Tom
--------------------------------------------------
From: "Larry Bates" <la*********@websafe.com`>
Sent: Monday, June 09, 2008 11:16 PM
Newsgroups: comp.lang.python
To: <py*********@python.org>
Subject: Re: Getting current screen resolution
Thomas Morton wrote:
>This is a "thing" that has been annoying me all morning: and I can't
work out how to do it.

I need a way to get the DPI or screen resolution of the monitor that a
script is currently runnign on.

I have a way in Windows but it doesnt port to Unix (which is important).

Any ideas?

warning - be very careful about trying to come up with something like
this.
Today it is common for people to have more than one monitor, so you will
need to take that into account. Just getting resolution of one monitor
might not be enough (but then I don't know EXACTLY what is is that you are
doing with the
resolution). I see a lot of software that ignores the dual-monitor
possibility.

-Larry
--
http://mail.python.org/mailman/listinfo/python-list
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Dufe | last post by:
Hello all: To deal with the problem of differing user screen resolutions, I've explored: 1) making the pages in PHP, 2) having different pages on the same page and selecting the proper one via...
3
by: JIM.H. | last post by:
Hello, Is there any way I can get current screen resolution setting in asp.net. I am trying to get it and set the reportviewer component size so that scroll bars on the reportviewer component are...
1
by: Carlos Albert | last post by:
Hi, I need to get some statistic about wich resolution are my customers using, how can I get the current screen resolution from the codebehind, so I can store it in a database?
5
by: Maxi | last post by:
I have a 30X16 cells table in my html page. Table height and width are set to 100%. I have set size of every cell inside the table to 24 pixel. When I open the html page in maximize state in...
4
by: pedestrian via DotNetMonster.com | last post by:
I'm creating WinForm app. I would like to set the form position according to current Screen resolution. So how could I find the current resolution? Thanks... -- Message posted via...
9
by: Steve Wright | last post by:
Hi I'm developing a webpage that needs to include a different stylesheet depending on the screen resolution. I know that I could read the resolution in javascript and then do some sort of...
3
by: Joe Withawk | last post by:
Using the Scleen class you can get information about the bounds of the displays on the system, but if you temporarely change the resolution (by creating a full screen directx device with other...
0
by: William Heymann | last post by:
On Monday 09 June 2008, Thomas Morton wrote: run xdpyinfo and pull the values you need from that.
10
by: =?Utf-8?B?UmljaA==?= | last post by:
A lot of users at my workplace use different screen resolutions, and I build apps to use 1680 x 1050 pixels res by default. But some users are using 800 x 600, and the apps are too large for their...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
0
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.