source: trunk/SRC/ToBeReviewed/PLOTS/DIVERS/givewindowsize.pro

Last change on this file was 496, checked in by smasson, 10 years ago

accept 2 elements windowsize_scale

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1;+
2;
3; @file_comments
4;
5; @categories
6;
7; @returns
8;
9; @keyword dpi {in}{optional}{type=scalar}{default=72}
10; used only in z buffer. specify the number of dots per inch.
11; used to define the size of the virtual window activated in the Z buffer.
12;
13; @keyword _EXTRA
14; Used to pass keywords
15;
16; @uses
17;
18; @restrictions
19;
20; @examples
21;
22; @history
23;
24; @version
25; $Id$
26;
27; @todo seb
28;-
29FUNCTION givewindowsize, dpi = dpi, _extra = ex
30;
31  compile_opt idl2, strictarrsubs
32;
33@cm_4ps
34IF NOT keyword_set(key_forgetold) THEN BEGIN
35@updatenew
36ENDIF
37;------------------------------------------------------------
38;
39   IF !d.name EQ 'Z' THEN BEGIN
40     IF NOT keyword_set(dpi) THEN dpi = 72
41     coef = dpi/2.54 ; 1 inch = 2.54 cm
42   ENDIF ELSE BEGIN
43     dimensions = get_screen_size(RESOLUTION = resolution)
44     coef = floor(1./resolution[0])
45   ENDELSE
46   if NOT keyword_set(windowsize_scale) then BEGIN
47     windowsize_scale = 1.
48     IF NOT keyword_set(key_forgetold) THEN BEGIN
49     @updateold
50     ENDIF
51   ENDIF
52   coef = windowsize_scale * coef
53   IF n_elements(coef EQ 1) THEN coef = [coef, coef]
54;
55    mipgsz = min(page_size, max = mapgsz)
56;
57    xsize = coef[0] * (mipgsz*key_portrait + mapgsz*(1-key_portrait))
58    ysize = coef[1] * (mipgsz*(1-key_portrait) + mapgsz*key_portrait)
59;
60   return, [xsize, ysize]
61end
Note: See TracBrowser for help on using the repository browser.