The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 using a script to save a graph as a bitmap

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
a_user Posted - 08/19/1998 : 2:52:00 PM
Hi. I'm a student working at the University of Toronto physics department, and
i just started using Origin last week. I've been having trouble with the
script command which is used to save graphs as bitmap files, namely

save -bs PlotName FileName Width Height

Actually, the frustrating part is that this command does seem to work, to the
extent that the graph does in fact save properly, but then I get a `Command
Error' message, and thus the rest of the script does not run. I have used this
command all by itself in a script, and have still had the same problem (again,
the graph does save as a bitmap, but I get an error message). Does anyone have
any idea what might be going on?

Thanks for the help.

1   L A T E S T    R E P L I E S    (Newest First)
a_user Posted - 08/19/1998 : 2:55:00 PM
Using a script to save a bitmap

The problem with the save -bs WindowName FileName Width Height was discovered only recently along with a similar problem with the file -c FileName1 FileName2 command.
This is the way to work around the problem until it is fixed:
Create a text file with the following:

[SaveBitmap]
save -bs %1 %2 %3 %4;

[FileCopy]
file -c %1 %2;

and save it with an OGS extension into your Origin directory (such as UTIL.OGS). You can then call this file and pass the various parameters as needed:

run.section(util,SaveBitmap,Graph1 image.bmp 400 300);

and here is the syntax for the new file copy:

run.section(util,FileCopy,c:\origin\origin.ini d:\backup\origin.ini);

This works because the behavior of LabTalk when encountering a Command Error running external scripts is to just exit the script and return and continue whatever script called the external routine.


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000