1 | ;------------------------------------------------------------ |
---|
2 | ;------------------------------------------------------------ |
---|
3 | ;------------------------------------------------------------ |
---|
4 | ;+ |
---|
5 | ; NAME:openps |
---|
6 | ; |
---|
7 | ; PURPOSE:ouverture de l''environement Postscript. au passage on sauve |
---|
8 | ; la palette dans les vecteurs rouge, vert et bleu puis on palit la |
---|
9 | ; couleur a l''aide ce palit. |
---|
10 | ; |
---|
11 | ; CALLING SEQUENCE:openps[,nomfich] |
---|
12 | ; |
---|
13 | ; INPUTS: |
---|
14 | ; nomfich: string donnant le nom du fichier ps a ouvrir, evite |
---|
15 | ; que openps ose la question :'Nom du fichier Postscript?' |
---|
16 | ; |
---|
17 | ; KEYWORD PARAMETERS: |
---|
18 | ; |
---|
19 | ; FILENAME: meme role que nomfich mais comme c''est un mot cle, |
---|
20 | ; il peut passer a travers les differentes routines via |
---|
21 | ; INFOWIDGET: a egaler a une variable qui contiendra l''id du |
---|
22 | ; widget qui informe qu''un cree un widget. |
---|
23 | ; _EXTRA: tous les mots cles se rapportant a la procedure device |
---|
24 | ; |
---|
25 | ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) |
---|
26 | ; 21/12/98 |
---|
27 | ; 1/2/98: ajout de nomfich en input |
---|
28 | ; 1/9/1999: ajout du mot cle FILENAME et du widget |
---|
29 | ;- |
---|
30 | ;------------------------------------------------------------ |
---|
31 | ;------------------------------------------------------------ |
---|
32 | ;------------------------------------------------------------ |
---|
33 | pro openps, nomfichier, FILENAME = filename, INFOWIDGET = infowidget, _extra = ex |
---|
34 | @common |
---|
35 | if !d.name EQ 'PS' then device,/close |
---|
36 | set_plot,'ps' |
---|
37 | ;------------------------------------------------------------ |
---|
38 | ; on sauve la palette ds rou, vert et bleu |
---|
39 | ;------------------------------------------------------------ |
---|
40 | tvlct, rouge, vert, bleu, /get |
---|
41 | palit,coefpalit |
---|
42 | ;------------------------------------------------------------ |
---|
43 | ; on choisit le nom du fichier |
---|
44 | ;------------------------------------------------------------ |
---|
45 | if keyword_set(filename) then nomfich = filename |
---|
46 | if n_elements(nomfichier) NE 0 then nomfich = nomfichier |
---|
47 | ; il faut choisir |
---|
48 | if n_elements(nomfich) EQ 0 then $ |
---|
49 | nomfich = xquestion('Nom du fichier Postscript?', 'idl.ps', /chkwid) |
---|
50 | nomfich = isafile(file = nomfich, iodir = psdir, /new) |
---|
51 | ;------------------------------------------------------------ |
---|
52 | ; on determine xsize, ysize, xoffset et yoffset |
---|
53 | ;------------------------------------------------------------ |
---|
54 | if key_portrait EQ 1 then begin |
---|
55 | xs = petitfeuille |
---|
56 | ys = grandfeuille |
---|
57 | xoff = 0 |
---|
58 | yoff = 0 |
---|
59 | ENDIF ELSE BEGIN |
---|
60 | xs = grandfeuille |
---|
61 | ys = petitfeuille |
---|
62 | xoff = 0 |
---|
63 | yoff = grandfeuille |
---|
64 | ENDELSE |
---|
65 | ;------------------------------------------------------------ |
---|
66 | ; on ouvre le postcript |
---|
67 | ;------------------------------------------------------------ |
---|
68 | device, /color,/palatino,LANDSCAPE=1-key_portrait,PORTRAIT=key_portrait $ |
---|
69 | ,xsize=xs,ysize=ys,xoffset=xoff,yoffset=yoff $ |
---|
70 | ,filename=strcompress(nomfich, /remove_all) $ |
---|
71 | ,bits_per_pixel=8,_extra = ex |
---|
72 | !p.font=0 |
---|
73 | ; |
---|
74 | if arg_present(infowidget) then $ |
---|
75 | infowidget = xnotice('Creation du Postscript en cours...') |
---|
76 | ; |
---|
77 | return |
---|
78 | END |
---|
79 | |
---|
80 | |
---|
81 | |
---|
82 | |
---|
83 | |
---|
84 | |
---|
85 | |
---|
86 | |
---|
87 | |
---|
88 | |
---|
89 | |
---|
90 | |
---|