Stefan Monnier <[EMAIL PROTECTED]> writes:

> > Is it possible to calculate an Emacs window's size in pixels?
> > `window-height' and `window-width' returns lines and columns.
> 
> There's frame-pixel-height in Emacs-CVS.
> There's also window-pixel-edges if you care about windows rather
> than frames.

Which means I can use this:

(defun window-height-pixels ()
  (let ((line-pixel-height-ratio (/ (+ (frame-pixel-height) 0.0) 
(frame-height)))
        (column-pixel-width-ratio (/ (+ (frame-pixel-width) 0.0) 
(frame-width))))
    (ftruncate (* (window-height) line-pixel-height-ratio))))

(defun window-width-pixels ()
  (let ((column-pixel-width-ratio (/ (+ (frame-pixel-width) 0.0) 
(frame-width))))
    (ftruncate (* (window-width) column-pixel-width-ratio))))

I see that the frame-pixel-functions is including window
decorations and stuff, but I guess it can work for my
purposes anyway.

Thanks!

/Mathias
_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Reply via email to