HP Forums

Full Version: saving a graph on the hp prime
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I plotted a graph in the geometry app and I wish to save it to use at a later time. If I take a screen shot and save it to my Mac, I don't know if or how to bring it back to the calculator. Is the HP Prime capable of saving my work? Tech support has no idea how to do this. In fact they said I was the first to ask this question. I am new to HP Prime and would be shocked if my work will be lost. Thanks to anyone who can help.
If all you need is to save it for later:

To save and restore a graphic screen within the HP Prime filesystem you can use the AFiles command.

An example of this is included in the SCR_GET and SCR_PUT procedures in my Accesibility: Fingerspelling demo program in the HP Prime library.

How you get that file to/from a Mac filesystem I don't know.

If you want to look at it on the Mac without using HP Prime emulator:
I believe you can also load/save as a jpeg/png but cannot confirm since I use Android and its not yet available on that.
You can use AFiles("name"):=<object>

There are several graphics buffers, and G0 is the "current screen" buffer. So as an example:


This will save the current screen into a file named currentscreen.png. This file can be found using the connectivity kit within whatever app was current when executing the command above. (For example, if you were in the Function app, then look within the Function app folder in the connectivity kit.) The file will be stored within the "Files" subfolder. Simply double click it (in the conn. kit) to open and view the image.

You can also "load" a screenshot in a similar manner. Use:


to load the current screen with the image. You may additionally need:


to actually see the image (to prevent screen refreshes until a key is pressed or until WAIT(-1) times out).

NOTE: This must be done in Home view (if typed manually) or via a non-CAS program.
Very interesting Han!
I did not know these possibilities of Afiles.

May I ask you: has it a special advantage to create a png file, instead of a file without extention or e.g. jpg?

Some remarks.
When you do these things in Home view you will not get the image you want because in Home view G0 contains the History of Home view and not the Plot view of the Geometry app, which we are interested in.

So we can only assign G0, which contains the Plot view of the geometry app, to the file: currentscreen.png, inside a program.

This program would look like:

EXPORT savescreen()
   STARTAPP(“Geometry”); // starts the geometry app
   STARTVIEW(1,1);    //starts the Plot view of the geometry app

We can make the stored image visible with this program:

EXPORT showimage()

But I think a better way to save the results is simply to make a copy of the Geometry app:
Press Apps.
Long press the Geometry app.
Press save, give it a name and you have a copy of it.

This has the advantage that you do not only have saved the graph but also the instructions and formulas which created it, so that you can easily modify it.

png are lossless compressed files. but are larger.
jpg do loose data, but are 'normally' smaller.

jpg is much better for pictures, png are more adapted to 'graphs'.

Thank you Cyrille.
Reference URL's