I use a mutable bmp & canvas to draw someting and save the picture
B4X:
Dim MyPic As Bitmap
Dim cvs As Canvas
.
.
.
' initialize pic & cabvas
MyPic.InitializeMutable(Siz,Siz)
cvs.Initialize2(MyPic)
.
.
.
' draw some on canvas
cvs.DrawLine(lastX,lastY,xx,yy,Hue,1dip)
.
.
.
' save pic
Out = File.OpenOutput(AppPath, s, False)
MyPic.WriteToStream(Out,100,"JPEG")