Camera

From NSB App Studio
Jump to navigation Jump to search

Description

The Camera control lets you take pictures using your device's camera and display them in a PictureBox. The contents of that PictureBox can be saved in a database or sent to a server. All the settings needed to take a picture can be set at design time in AppStudio: no additional code needs to be written.

The default icon is a camera icon. You can change this to a different icon or text.

The Cameral control has the same properties as a Button, with one addition, the picturebox property.

The control requires iOS7.1 or later. For Android web apps, use Chrome 31 or greater. If you are using PhoneGap, use the PhoneGap Camera plugin.

When saving to an SQL data base via a PHP script, the data can be corrupted. If you encodeURIComponent the Base64 string it is saved ok. As follows:

 postData = postData & "&imgBase64=" & encodeURIComponent(PictureBox1.toDataURL())

Properties and Methods

Standard properties are supported, plus:

src Path to icon. Default is a camera. Design time.
picturebox The ID of the PictureBox control on the form to put the picture into. Design time.
picturebox.toDataURL() The picture, in Base64 format, in .png. Runtime.
value The title of the button. Design time or runtime.

Events

Events are handled by the control itself.

Example

No code needed - it just works!

Output

Related Items