The new, improved camera library has a lot of new functions! These include: flashlight, scene modes, orientations, front- and back camera, picture size, white balance and a lot more! Only one process can access the camera at any time. Therefore it is highly recommended to initialize the camera object in Activity_Resume and release it in Activity_Pause. A working example with explanations is available here. This is an 'Activity Object', it cannot be declared under Sub Process_Globals.
Sets the Antibanding. ANTIBANDING_50HZ: Sets the antibanding to 50Hz. ANTIBANDING_60HZ: Sets the antibanding to 60Hz. ANTIBANDING_AUTO: Sets the antibanding to automatic mode. ANTIBANDING_OFF: Sets the antibanding off. For example: Camera1.setAntibanding = "ANTIBANDING_AUTO"
AppTrial (FrameProtect AsString, WebServer AsString, IMEI AsString, Period AsString)
A trial for your app. Sends a HTTP POST method to the webserver. FrameProtect = Small Password Protection WebServer = URL to listening PHP file IMEI = The Device IMEI Period = the amount that the app can be opened.
Listen on Webserver for: "PHPProtect" "IMEI" "TrialPeriod"
AvailableFrame AsBoolean [read only]
If there is an available frame.
CameraBack
Use the back camera as primary. Old
CameraBack2
Use the back camera as primary.
CameraFront
Use the front camera as primary. Return type: @return:
CameraFront2
Use the front camera as primary.
ColourEffect AsString [write only]
Sets the color effect of a picture. The following effects are: AQUA, BLACKBOARD, MONO, NEGATIVE, NONE, POSTERIZE, SEPIA, SOLARIZE, WHITEBOARD. For example: Camera1.setColourEffect = "SEPIA"
Detect faces in a picture. It makes a red rectangle around the face. Filename = the name of the file that will be saved with the rectangles on the SD Card. Bitmap = mutable or immutable bitmap image Width = bitmap width Height = bitmap height maxFaces = the maximum amount of faces to look for. Dim btmp As Bitmap btmp.Initialize(File.DirRootExternal,"faces_2004W_comp1.jpg") Camera1.detectFaces("detectedFace",btmp,btmp.Width,btmp.Height,43)
DroidLED
Do not use this
EULER_X AsInt
EULER_Y AsInt
EULER_Z AsInt
ExposureCompensation AsInt
Gets the exposure compensation. A technique for adjusting the exposure indicated by a photographic exposure meter.
FaceConfidence AsFloat [read only]
Returns a confidence factor between 0 and 1. This indicates how certain what has been found is actually a face. A confidence factor above 0.3 is usually good enough. Given by the last found face.
FaceEyesDistance AsFloat [read only]
Returns the distance between the eyes. Given by the last found face.
FaceFound AsInt [read only]
Returns all found faces on the picture Given by the last found face.
FaceMidPointX AsFloat [read only]
Returns the midpoint of the eyes on the x-axis. Given by the last found face.
FaceMidPointY AsFloat [read only]
Returns the midpoint of the eyes on the y-axis. Given by the last found face.
FlashAuto
Enables the flashlight to turn on automatically.
FlashOff
Turns the flashlight off.
FlashOn
Turns the flashlight on.
FlashTorch
Turns the flashlight on (Torch Mode).
FocalLength AsFloat [read only]
Gets the focal length (in millimeter) of the camera. Returns the focal length. This method will always return a valid value.
FocusMode AsString [write only]
Sets the focus mode. MACRO: Close-up, INFINITY: Far distance. FIXED: If the camera has auto-focus, this mode can fix the focus. AUTO: Auto-focus mode, EDOF: Focusing is done digitally and continuously. For example: Camera1.setFocusMode = "MACRO"
Gets the picture on the current frame. Width: the width of the picture. Height: the height of the picture Quality: the quality of the jpeg image. Calls _PreviewTaken when finished.
getSupportedPictureSizeHeight (index AsInt) AsInt
Returns the supported picture height of the given index. You can call getSupportedPictureSize to get the size of the list. This way you can extract the index of the supported sizes Return type: @return:
getSupportedPictureSizeWidth (index AsInt) AsInt
Returns the supported picture width of the given index. You can call getSupportedPictureSize to get the size of the list. This way you can extract the index of the supported sizes Return type: @return:
GPSAltitude AsDouble [write only]
Sets GPS altitude.
GPSLatitude AsDouble [write only]
Sets GPS latitude coordinate. This will be stored in JPEG EXIF header.
GPSLongitude AsDouble [write only]
Sets GPS longitude coordinate. This will be stored in JPEG EXIF header.
GPSTimeStamp AsLong [write only]
Sets GPS timestamp. This will be stored in JPEG EXIF header.
timestamp GPS timestamp (UTC in seconds since January 1, 1970).
HorizontalViewAngle AsFloat [read only]
Gets the horizontal angle of view in degrees. Returns horizontal angle of view. This method will always return a valid value.
Initializes the camera. Panel - The preview images will be displayed on the panel. EventName - Events subs prefix. The Ready event will be raised when the camera has finished opening.
isDecoding AsBoolean [read only]
returns true if frame is decoding.
isLEDEnabled AsBoolean
Checks if the Motorola droid LED is enabled. Return type: @return:
ISOValue AsInt [write only]
Sets the iso value. Note that this MIGHT not work (properly).
isZoomSupported AsBoolean
Returns a true or false statement when zooming is supported or not. Return type: @return:
LEDenable (tf AsBoolean)
Enable true or false the Motorola Droid LED. tf:
MaxExposureCompensation AsInt [read only]
Returns the maximum exposure compensation.
MaxZoom AsInt [read only]
Returns the maximum zooming level. 0 is no zooming supported.
MinExposureCompensation AsInt [read only]
Returns the minimum exposure compensation.
mIsFlashlightOn AsBoolean
onPreviewFrame (data() AsByte, camera As android.hardware.Camera)
openFrontFacingCameraGingerbread
Since api 2.3 Return type: @return:
OriLandscape
Sets the camera orientation to landscape.
OriLandscapeAPI8
Sets the camera orientation to landscape. API Level 8 and down
OriPortrait
Sets the camera orientation to portrait.
OriPortraitAPI8
Sets the camera orientation to portrait. API Level 8 and down
ParmStr AsString
PictureSize (width AsInt, height AsInt)
Sets the size of the picture in pixels.
pose (euler AsInt) AsFloat
Returns the face's pose. That is, the rotations around either the X, Y or Z axis (the positions in 3-dimensional Euclidean space). Euler: EULER_X, EULER_Y or EULER_Z
PreviewFormat AsInt [read only]
Returns the image format for preview frames got from Camera.PreviewCallback.
PreviewFrameRate AsInt
Gets or sets the current Preview frame rate.
Quality AsInt [write only]
Sets the quality of the JPEG file. The range is between 1 to 100, with 100 being the best.
rCPKey (k AsString) AsString
Read Camera Parameter Key With this you can read parameters from the camera. k: Return type: @return:
reconnect
Reconnects the camera.
Release
Releases the camera object and allows other processes to access the camera.
removeGPSData
Removes the attached GPS Data.
rotateBitmap (bitmapAs android.graphics.Bitmap, degrees AsInt) As android.graphics.Bitmap
Rotates a bitmap with x degrees and returns a new one (rotated.) bitmap: degrees: Return type: @return:
rotateBitmap2 (data() AsByte, degrees AsInt) As android.graphics.Bitmap
Rotates a bitmap (from a byte array) with x degrees and returns a new one. bitmap: degrees: Return type: @return:
SceneMode AsString [write only]
Sets the Scene Mode. ACTION: Take photos of fast moving objects., AUTO: Scene mode is off. BEACH: Take pictures on the beach CANDLELIGHT: Capture scenes lit by candles, FIREWORKS: Take pictures of fireworks. LANDSCAPE: Take pictures on distant objects., NIGHT: Take photos at night. PARTY: Indoor low-light shot., PORTRAIT: Take people pictures. SNOW: in the snow., STEADYPHOTO: Avoid blurry pictures (handshake). SUNSET: Take Sunset photos., THEATRE: Take photos in a theater. For example: Camera1.setScene = "BEACH"
setPreviewFpsRange (min AsInt, max AsInt)
Sets the supported Preview FPS Range.a list of supported preview fps ranges. This method returns a list with at least one element. Every element is an int array of two values - minimum fps and maximum fps. The list is sorted from small to large (first by maximum fps and then minimum fps).
setResolution (width AsInt, height AsInt)
Sets the dimensions for preview pictures. The sides of width and height are based on camera orientation. That is, the preview size is the size before it is rotated by display orientation. So applications need to consider the display orientation while setting preview size. For example, suppose the camera supports both 480x320 and 320x480 preview sizes. The application wants a 3:2 preview ratio. If the display orientation is set to 0 or 180, preview size should be set to 480x320. If the display orientation is set to 90 or 270, preview size should be set to 320x480. The display orientation should also be considered while setting picture size and thumbnail size.
Sets the zooming level. Set zoom to 2x if available. This helps encourage the user to pull back. Some devices like the Behold have a zoom parameter Most devices, like the Hero, appear to expose this zoom parameter. (I think) This means 2.0x e.g zoom(2,"2.0","20") I got thix from the ZXing App
setZoomIn
Zooms in. (is possible not to work on some devices.)
setZoomOut
Zooms out. (is possible not to work on some devices.)
StartPreview
Starts displaying the preview images.
StopPreview
Stops displaying the preview images.
SupportedAntibanding As java.util.List [read only]
Returns a list of all supported antibandings.
SupportedColourEffect As java.util.List [read only]
Returns a list of all supported colour effects.
SupportedFlashMode As java.util.List [read only]
Returns a list of all supported flash modes.
SupportedFocusMode As java.util.List [read only]
Returns a list of all supported focus modes.
SupportedPictureFormats As java.util.List [read only]
Returns a list of all supported Picture Formats.
SupportedPictureSize AsInt [read only]
Returns the size of the supported pictures off the device. e.g returns 4 when 4 sizes are supported.
SupportedPreviewFpsRange As java.util.List [read only]
Gets the supported Preview FPS Range.a list of supported preview fps ranges. This method returns a list with at least one element. Every element is an int array of two values - minimum fps and maximum fps. The list is sorted from small to large (first by maximum fps and then minimum fps).
SupportedPreviewFrameRates As java.util.List [read only]
Gets the supported Preview frame rate.
SupportedSceneMode As java.util.List [read only]
Returns a list of all supported scene modes.
SupportedWhiteBalance As java.util.List [read only]
Returns a list of all supported white balances.
TakePicture
Takes a picture. When the picture is ready, the PictureTaken event will be raised. You should not call TakePicture while another picture is currently taken. The preview images are stopped after calling this method. You can call StartPreview to restart the preview images.
TakePicture2 (degrees AsFloat)
Takes a picture and rotates it. When the picture is ready, the PictureTaken2 event will be raised. You should not call TakePicture while another picture is currently taken. The preview images are stopped after calling this method. You can call StartPreview to restart the preview images.
degrees: the amount of degrees the bitmap should be turned. asBitmap: whether you want to retrieve the bitmap (true) or bytearray (false).
toggleFlashLight
Attempts to set camera flash torch/flashlight mode on/off HACK around isOn: true = on, false = off Return type: @return:boolean whether or not we were able to set it If you have a Samsung, and you toggle the flash off, you will have to reinitialize your camera.
Encodes a bytearray image with Base64 and uploads it to a web client that supports PHP. WebClient: a string referring to your base.php file (http://IP:Port/base.php) e.g. "http://192.168.1.100/android/base.php, "http://www.mywebsite.com/index.php
PHPProtect is a small password protection to check on your websserver Webserver: "image" = frame Webserver: "PHPProtect" = FrameProtect
VerticalViewAngle AsFloat [read only]
Gets the vertical angle of view in degrees. Returns vertical angle of view. This method will always return a valid value.
WhiteBalance AsString [write only]
Sets the white balance. The following effects are: AUTO, CLOUDY_DAYLIGHT, DAYLIGHT, FLUORESCENT, INCANDESCENT, SHADE, TWILIGHT, WARM_FLUORESCENT. For example: Camera1.setEffect = "WARM_FLUORESCENT"
wiCPKey (k AsString, v As Integer)
Write Integer Camera Parameter Key With this you can write integer parameters to the camera. k: Return type: @return:
wsCPKey (k AsString, v AsString)
Write String Camera Parameter Key With this you can write string parameters to the camera. k: Return type: @return:
Top