Revision 495
(checked in by cbc, 12 years ago)
|
Initial import of Stark code.
|
Line | |
---|
1 |
function output_image(fname) |
---|
2 |
% Output a set of images for the current figure |
---|
3 |
% The outputs are |
---|
4 |
% 1) <fname>.ps |
---|
5 |
% 2) <fname>.jpg (640X480) |
---|
6 |
% 3) <fname>.jpg.small (320X240) |
---|
7 |
% |
---|
8 |
% Call as: output_image(fname) |
---|
9 |
|
---|
10 |
|
---|
11 |
drawnow % just in case |
---|
12 |
|
---|
13 |
orig_size=get(gcf,'position'); |
---|
14 |
orig_unit=get(gcf,'units'); |
---|
15 |
|
---|
16 |
%fnameps=[fname '.ps']; |
---|
17 |
%eval(['print -depsc ' fnameps]) |
---|
18 |
|
---|
19 |
set(gcf,'units','pixels','position',[orig_size(1) orig_size(2) 640 480]) |
---|
20 |
drawnow |
---|
21 |
shg |
---|
22 |
[X,MAP] = getframe(gcf); |
---|
23 |
imwrite(X,MAP,[fname '.jpg'],'jpeg') |
---|
24 |
|
---|
25 |
%set(gcf,'units','pixels','position',[orig_size(1) orig_size(2) 320 240]) |
---|
26 |
set(gcf,'units','pixels','position',[orig_size(1) orig_size(2) 240 180]) |
---|
27 |
drawnow |
---|
28 |
shg |
---|
29 |
[X,MAP] = getframe(gcf); |
---|
30 |
imwrite(X,MAP,[fname '.jpg.small'],'jpeg') |
---|
31 |
|
---|
32 |
|
---|
33 |
|
---|
34 |
set(gcf,'Units',orig_unit,'Position',orig_size) |
---|