I am trying to initialize a Mutable Bitmap so I can draw onto it with a canvas and then save to disk without drawing onto the activity, but I get Unknown member: initializemutable
InitializeMutable (Width As Int, Height As Int)
Creates a new mutable bitmap with the specified dimensions. You can use a Canvas object to draw on this bitmap.
If I declare as bitmap, it compiles, but afterward I get this :
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true ** Error occurred on line: 39 (Main)
java.lang.IllegalArgumentException: method anywheresoftware.b4a.objects.drawable.CanvasWrapper.Initialize argument 1 has type android.view.View, got android.graphics.Bitmap
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:753)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:343)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at b4a.canvas.main.afterFirstLayout(main.java:102)
at b4a.canvas.main.access$000(main.java:17)
at b4a.canvas.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6134)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
** Activity (main) Resume **
Private bitmap2 As Bitmap
bitmap2.InitializeMutable(800,600)
cvs.Initialize2(bitmap2)
cvs.DrawColor(Colors.Green)
Dim Out As OutputStream
Out = File.OpenOutput(File.DirRootExternal, "reTest.png", False)
cvs.Bitmap.WriteToStream(Out, 100, "PNG")
Out.Close