B4A Library CameraFilter - 12 Aug: update in post #26

Johan Schoeman

Expert
Licensed User
Longtime User
Attached new library files and B4A project that will allow you to take photos with the back facing camera (I need to sort out the front facing camera as it is upside down). See the camera icon at the top right. Photos taken will be stored/saved in the root folder of your device.


 

Attachments

  • CameraFilterLibFilesNew.zip
    26.9 KB · Views: 186
  • b4aCameraFilterNew.zip
    256 KB · Views: 165

susu

Well-Known Member
Licensed User
Longtime User
I didn't try your lib yet but it looks really cool. Can I move the camera button and change the folder to save picture?
Thank you Johan.
 

susu

Well-Known Member
Licensed User
Longtime User
I tested new lib but when I click on "Start CameraFilter" button there's error:


I didn't use AppCombat lib and changed Additional Res path correctly.
 

Johan Schoeman

Expert
Licensed User
Longtime User
I tested new lib but when I click on "Start CameraFilter" button there's error:



I didn't use AppCombat lib and changed Additional Res path correctly.
Try to clean the B4A project and see if it solves it.
 

Johan Schoeman

Expert
Licensed User
Longtime User
I tested new lib but when I click on "Start CameraFilter" button there's error:



I didn't use AppCombat lib and changed Additional Res path correctly.
I have updated the lib to the most recent code of the Github project (about 7 hours ago) but have added the ability to specify the folder and file name of the photos (note that the file name will automatically be appended with the name of the filter and a date + time stamp). My completed B4A folder has been zipped and you can download it from HERE. Use the attached library files with this B4A 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"
  
    camerafilter.FolderName = "CAMERAFILTER"
    camerafilter.PictureName = "filter"           'this will automatically be appended with the name of the filter, the date, and the time (store as a png file)

End Sub

Sub Activity_Resume
  
  
End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub Button1_Click
  
  camerafilter.StartCameraFilter

End Sub
 

Attachments

  • CameraFilterLibFiles120816.zip
    31 KB · Views: 176

susu

Well-Known Member
Licensed User
Longtime User
Hi Johan,

I downloaded new lib, new B4A project. I cleaned the project before compile. I can compile your sample code but when I click on "Start CameraFilter" button, there's the same error.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi Johan,

I downloaded new lib, new B4A project. I cleaned the project before compile. I can compile your sample code but when I click on "Start CameraFilter" button, there's the same error.
The APK that was created with B4A should be somewhere in the B4A folder (my original project). Install it and see if it runs....
 

susu

Well-Known Member
Licensed User
Longtime User
Your apk worked! It's strange
 

susu

Well-Known Member
Licensed User
Longtime User
I got the same error with your previous lib. Could you please add some things like:
- Add camera filter by code with customized size.
- Add capture button anywhere by code.
- Size of pixel/effect can be changed.
- Save picture in Jpeg.

I know I ask too much. But I believe you can do it. I will donate to you as my thanks.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…