[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Current screen size
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Current screen size
- From: "Rikard Bosnjakovic" <rikard.bosnjakovic@xxxxxxxxx>
- Date: Mon, 25 Sep 2006 17:22:52 +0200
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Mon, 25 Sep 2006 11:23:02 -0400
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=N1iWYzQOjbkAkmmF435ElvFjRNbMpVu/dRLy4bM34I5WO2/xiLXit29ApyY8FnsGpQFeihX2hDhDq7nijy4zqxzeWzP5vWeYHCJonsuUFtcZdT5rtKI/fzXNPbXmx3wvF0Ozvme69UYc2K3HGCE0H31NP8zVbxrXMpb79/KoCfY=
- In-reply-to: <1159173340.10285.18.camel@localhost>
- References: <1159173340.10285.18.camel@localhost>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
On 9/25/06, John Eriksson <john@xxxxxxxxxxxx> wrote:
Hi,
Is there a way to determine the desktops current screen resolution?
From within pygame, I don't know of a way. If you have PIL (Python
Imaging Library) installed, and run under Windows, you can use it like
this:
# -----
import ImageGrab
desktop_size = ImageGrab.grab().size # (width, height)
# -------
Not very portable (since it's a Windows-only solution) and not very
Pygame-ish, but it works.
--
- Rikard.