#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim camera1 As Camera
Private PanelFoto As Panel
Private BtnTomarFoto As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("FrmTomarFoto")
End Sub
Sub Camera1_Ready (Success As Boolean)
If Success Then
camera1.StartPreview
BtnTomarFoto.Enabled = True
Else
Msgbox("No Se puede Abrir la Camara","Advertencia")
End If
End Sub
Sub Activity_Resume
BtnTomarFoto.Enabled = False
camera1.Initialize(PanelFoto, "Camera1")
End Sub
Sub Activity_Pause (UserClosed As Boolean)
camera1.Release
End Sub
Sub Camera1_PictureTaken (Data() As Byte)
camera1.StartPreview
Dim out As OutputStream
out = File.OpenOutput(File.DirRootExternal, "Download/1.jpg", False)
out.WriteBytes(Data, 0, Data.Length)
out.Close
Msgbox("Imagen Almacenada Correctamente.","Felicitaciones!!!")
FrmAddServicio.Foto_Tomada=1
Activity.Finish
End Sub
Sub BtnTomarFoto_Click
BtnTomarFoto.Enabled = False
camera1.TakePicture
End Sub