This is a read-only mirror of pymolwiki.org

Viewport

From PyMOL Wiki
Revision as of 17:01, 28 September 2011 by James (talk | contribs) (Added instructions to reliably obtain viewport dimensions.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

viewport changes the size of the viewing port--the visible openGL window (and thus the size of all png files subsequently output).

No API command can reliably retrieve the viewport dimensions under all circumstances. However, it is possible to obtain the dimensions using a third party image viewer like Gimp or OS X Preview:

  1. Save the current view as a png file ("png imagename.png").
  2. Determine the image dimensions using a viewer program.

These dimensions can be used directly using the viewport command or the API.

USAGE

viewport width, height

PYMOL API

cmd.viewport(int width, int height)