background image
Original Author Paul Laughton, 2011
Page 180
De Re BASIC!
Note: Some devices like the Nexus 7 do not come with a built in camera interface. If you have installed
an aftermarket camera application then it will be called when executing this command. You can take
pictures with the Nexus 7 (or similar devices) using the other commands even if you do not have camera
application installed. If the device does not have any installed camera apps, then there will be a run-time
error message, "This device does not have a camera."
Gr.camera.autoshoot <bm_ptr_nvar>{, <flash_ mode_nexp> {, focus_mode_nexp} }
An image is captured as soon as the command is executed. No user interaction is required. This
command can be used for untended, time-sequence image captures.
The optional flash_mode numeric expression specifies the flash operation:
0
Auto Flash
1
Flash On
2
Flash Off
3
Torch
4
Red-eye
The default, if no parameter is given, is Auto Flash.
The optional focus_mode numeric expression specifies the camera focus:
0
Auto Focus
1
Fixed Focus
2
Focus at Infinity
3
Macro Focus (close-up)
The default, if no parameter is given, is Auto Focus.
If you want to specify a focus mode, you must also specify a flash mode.
The command also stores the captured image into the file, "<pref base drive>/rfo-
basic/data/image.png".
Gr.camera.manualShoot <bm_ptr_nvar>{, <flash_ mode_nexp> {, focus_mode_nexp} }
This command is much like Gr.camera.autoshoot except that a live preview is shown on the screen. The
image will not be captured until the user taps the screen.
Other Graphics Commands
Gr.screen.to_bitmap <bm_ptr_nvar>
The current contents of the screen will be placed into a bitmap. The pointer to the bitmap will be
returned in the bm_ptr variable. If there is not enough memory available to create the bitmap, the
returned bitmap pointer is -1. Call GETERROR$() for information about the failure.
Please note the idiosyncratic underscore in the command.