Camera: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
No edit summary
 
(13 intermediate revisions by the same user not shown)
Line 5: Line 5:
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 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 Cameral control has the same properties as a Button, with one addition, the picturebox property.
The default icon is a camera icon. You can change this to a different icon or text.
 
The control requires iOS7.1 or later. For Android web apps, use Chrome 31 or greater. If you are using VoltBuilder, use the [https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-camera/index.html cordova-plugin-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:
<pre>
  postData = postData & "&imgBase64=" & encodeURIComponent(PictureBox1.toDataURL())
</pre>
 
== Properties and Methods ==
== Properties and Methods ==


Line 11: Line 19:
{| class="wikitable"
{| class="wikitable"
|-
|-
| corners || round or square. jQuery Mobile only.
| icon || Icon to show from the Font Awesome set. Default is 'camera'. Examples: trash, check. http://fontawesome.io/icons/ Design Time.
|-
|-
| icon || Set to false for no icon. You have a choice of 18 standard icons otherwise.  
| picturebox || The ID of the PictureBox control on the form to put the picture into. Design time.
|-
|-
| iconPos || Position of the icon. Can be none, left, right, top, bottom or notext.
| picturebox.toDataURL() || The picture, in Base64 format, in .png. Runtime.
|-
| image || Path to image to show instead of title on the button.  
|-
| mini || true/false. For jQuery Mobile, should the text be normal size or mini size?
|-
| picturebox || The ID of the PictureBox control on the form to put the picture into.
|-
|-
| value || The title of the button. Design time or runtime.
| value || The title of the button. Design time or runtime.
Line 33: Line 35:


No code needed - it just works!
No code needed - it just works!
</pre>


== Output ==
== Output ==

Latest revision as of 22:35, 12 November 2020

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 control requires iOS7.1 or later. For Android web apps, use Chrome 31 or greater. If you are using VoltBuilder, use the cordova-plugin-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:

icon Icon to show from the Font Awesome set. Default is 'camera'. Examples: trash, check. http://fontawesome.io/icons/ 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