hola tengo un programa que toma fotografías y la pasa al teléfono , el problema que tengo es que pesan 2.5 megas demasiado , necesito bajarlas de tamaño, encontré una librería llamada RSImageProcessing pero no se como ocuparla.
Espero que alguien pueda orientarme.
gracias.
codigo fuente.
'Activity module
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
Dim camera1 As Camera
Dim btnTakePicture As Button
Dim Panel1 As Panel
'Dim r As RSImageProcessing
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
End Sub
Sub Camera1_Ready (Success As Boolean)
If Success Then
camera1.StartPreview
btnTakePicture.Enabled = True
Else
ToastMessageShow("Cannot open camera.", True)
End If
End Sub
Sub Activity_Resume
btnTakePicture.Enabled = False
camera1.Initialize(Panel1, "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, "/seguridad/1.jpg", False)
out.WriteBytes(Data, 0, Data.Length)
out.Close
ToastMessageShow("Image saved: " & File.Combine(File.DirRootExternal, "1.jpg"), True)
btnTakePicture.Enabled = True
End Sub
'funcion que no se como aplicarla.
Sub ReSize(b As Bitmap, newWidth As Int, newHeight As Int) As Bitmap
Dim r As RSImageProcessing
Return r.scaleBitmap(b, newWidth, newHeight)
End Sub
Sub btnTakePicture_Click
btnTakePicture.Enabled = False
camera1.TakePicture
End Sub
Espero que alguien pueda orientarme.
gracias.
codigo fuente.
'Activity module
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
Dim camera1 As Camera
Dim btnTakePicture As Button
Dim Panel1 As Panel
'Dim r As RSImageProcessing
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
End Sub
Sub Camera1_Ready (Success As Boolean)
If Success Then
camera1.StartPreview
btnTakePicture.Enabled = True
Else
ToastMessageShow("Cannot open camera.", True)
End If
End Sub
Sub Activity_Resume
btnTakePicture.Enabled = False
camera1.Initialize(Panel1, "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, "/seguridad/1.jpg", False)
out.WriteBytes(Data, 0, Data.Length)
out.Close
ToastMessageShow("Image saved: " & File.Combine(File.DirRootExternal, "1.jpg"), True)
btnTakePicture.Enabled = True
End Sub
'funcion que no se como aplicarla.
Sub ReSize(b As Bitmap, newWidth As Int, newHeight As Int) As Bitmap
Dim r As RSImageProcessing
Return r.scaleBitmap(b, newWidth, newHeight)
End Sub
Sub btnTakePicture_Click
btnTakePicture.Enabled = False
camera1.TakePicture
End Sub