java.lang.ArrayIndexOutOfBoundsException error
I am trying to use image RSImageprocessing library to get sketch effect
my code is like this
Code:
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 io As RSImageProcessing
Dim ii As RSImageEffects
Dim ifilter As RSImageFilters
Dim panel1 As Panel
Dim button_sketch As Button
Dim filedire As String
Dim bitmap1 As Bitmap
Dim imageview1 As ImageView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("layout1")
' If File.IsDirectory(File.DirRootExternal,"/Sketchy/") =False Then
' File.MakeDir(File.DirRootExternal,"/sketchy/")
' End If
' filedire=File.DirRootExternal & "/Sketchy/"
panel1.SetLayout(0,0,100%x,100%y)
button_sketch.SetLayout(50dip,100%y-40dip,100dip,40dip)
imageview1.SetLayout(5dip,50dip,100%x-10dip,0.70*100%x)
' bitmap1.Initialize(File.DirAssets,"IMG_2436.jpg")
imageview1.Bitmap = LoadBitmapSample(File.DirAssets,"IMG_2436.jpg",600,480)
io.Initialize
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button_sketch_Click
imageview1.Bitmap = ii.Sketchify(LoadBitmapSample(File.DirAssets,"IMG_2436.jpg",600,480),16,0)
End Sub
I am getting error java.lang.ArrayIndexOutOfBoundsException
** Activity (main) Create, isFirst = true **
RSSketchLibrary has been initialized.
** Activity (main) Resume **
main_button_sketch_click (B4A line: 50)
imageview1.Bitmap = ii.Sketchify(LoadBitmapSample(File.DirAssets,"IMG_2436.jpg",600,480),16,0)
java.lang.ArrayIndexOutOfBoundsException
at com.rootsoft.imageprocessing.ConvolutionMatrix.computeConvolution3x3(ConvolutionMatrix.java:60)
at com.rootsoft.imageprocessing.RSImageEffects.Blur(RSImageEffects.java:87)
at com.rootsoft.imageprocessing.RSImageEffects.Sketchify(RSImageEffects.java:936)
at com.orange.sketch.main._button_sketch_click(main.java:288)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:158)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:54)
at android.view.View.performClick(View.java:2538)
at android.view.View$PerformClick.run(View.java:9152)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)
java.lang.ArrayIndexOutOfBoundsException
Connected to B4A-Bridge
Where I am erring ?