help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calculate window size in pixels


From: Mathias Dahl
Subject: Re: Calculate window size in pixels
Date: 06 May 2005 19:12:32 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Mathias Dahl <address@hidden> writes:

> And even better:
> 
> (defun window-height-pixels ()
>   (let ((line-pixel-height-ratio (/ (+ (frame-pixel-height) 0.0) 
> (frame-height))))
>     (truncate (* (window-height) line-pixel-height-ratio))))
> 
> (defun window-width-pixels ()
>   (let ((column-pixel-width-ratio (/ (+ (frame-pixel-width) 0.0) 
> (frame-width))))
>     (truncate (* (window-width) column-pixel-width-ratio))))

Shameful plug:

You can now see this in action in `tumme-display-image' in
the newest version of tumme.el:

 http://www.emacswiki.org/cgi-bin/wiki/Tumme

/Mathias


reply via email to

[Prev in Thread] Current Thread [Next in Thread]