all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pascal Bourguignon <pjb@informatimago.com>
Subject: Re: Calculate window size in pixels
Date: Fri, 06 May 2005 12:40:12 +0200	[thread overview]
Message-ID: <87wtqczlgz.fsf@thalassa.informatimago.com> (raw)
In-Reply-To: uwtqcsoph.fsf@gmail.com

Mathias Dahl <brakjoller.rem0veth1s@gmail.com> writes:

> Is it possible to calculate an Emacs window's size in pixels?
> `window-height' and `window-width' returns lines and columns.
>
> I guess this have to do with the frame's default font or
> something. Having two functions, `window-height-pixels' and
> `window-width-pixels' would be nice :)
>
> Can it be done?
>
> The reason that I want this is to be able to figure out to what size I
> have to resize an image to before inserting it into a window, so that
> it fits snugly.

It depends on the window manager.  With X, (when (eq window-system 'x) 
you'd use:
   x-display-pixel-width
   x-display-pixel-height
)


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
Until real software engineering is developed, the next best practice
is to develop with a dynamic system that has extreme late binding in
all aspects. The first system to really do this in an important way
is Lisp. -- Alan Kay

  reply	other threads:[~2005-05-06 10:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-06  9:12 Calculate window size in pixels Mathias Dahl
2005-05-06 10:40 ` Pascal Bourguignon [this message]
2005-05-06 14:12 ` Stefan Monnier
2005-05-06 14:40   ` Klaus Straubinger
2005-05-06 15:36   ` Mathias Dahl
2005-05-06 15:40     ` Mathias Dahl
2005-05-06 17:12       ` Mathias Dahl
2005-05-06 17:55       ` Kevin Rodgers
     [not found]       ` <mailman.3776.1115402969.2819.help-gnu-emacs@gnu.org>
2005-05-07 17:51         ` Mathias Dahl
2005-05-09 11:02       ` Ehud Karni
     [not found]       ` <mailman.4226.1115637000.2819.help-gnu-emacs@gnu.org>
2005-05-10 10:28         ` Mathias Dahl
2005-05-11  6:36           ` Mathias Dahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wtqczlgz.fsf@thalassa.informatimago.com \
    --to=pjb@informatimago.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.