A shortcut wrap for this Github project. It applies a variety of filters to the live preview of the camera. I have asked the author of the Github project to add the necessary code so that pictures can be taken. He has agreed to do so and I will post an updated project once that is done.
You need the following Jars in your additional library folder (recent versions):
android-support-v7-appcompat.jar
android-support-v4.jar
Take note of the following code in the B4A project and set you path to suite your own computer:
Posting the following:
1. B4A library files - copy them to your additional library folder
2. B4A sample project
Sample code:
Pics of some of the available preview filters:
You need the following Jars in your additional library folder (recent versions):
android-support-v7-appcompat.jar
android-support-v4.jar
Take note of the following code in the B4A project and set you path to suite your own computer:
B4X:
'IMPORTANT!!!! YOU NEED TO SET THE FOLLOWING PATHS CORRECTLY FOR YOUR OWN COMPUTER!!!!!!!!!!!!!!!!!!
'THE BELOW PATH IS THE PATH FOR MY COMPUTER
#AdditionalRes: C:\ANDRIOD_SDK_TOOLS\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
Posting the following:
1. B4A library files - copy them to your additional library folder
2. B4A sample project
Sample code:
B4X:
#Region Project Attributes
#ApplicationLabel: CameraFilter
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#AdditionalRes: ..\resource
#AdditionalRes: ..\CameraFilter_res
'IMPORTANT!!!! YOU NEED TO SET THE FOLLOWING PATHS CORRECTLY FOR YOUR OWN COMPUTER!!!!!!!!!!!!!!!!!!
'THE BELOW PATH IS THE PATH FOR MY COMPUTER
#AdditionalRes: C:\ANDRIOD_SDK_TOOLS\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
#Extends: android.support.v7.app.AppCompatActivity
#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.
Private Button1 As Button
Private Label1 As Label
Dim camerafilter As CameraFilter
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("main")
camerafilter.Initialize("camerafilter")
Label1.Visible = True
Label1.Text = "Wrapped by Johan Schoeman"
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
camerafilter.StartCameraFilter
End Sub
Pics of some of the available preview filters:
Attachments
Last edited: