Android Question CanvasView, Save changes

rscheel

Well-Known Member
Licensed User
Longtime User
I'm trying the @Johan Schoeman CanvasView library, with which I make a drawing in an image, the theme is how I can save the image changes.

B4X:
Sub Globals
    Private cv1 As CanvasView
    Dim b As Bitmap
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("LayoutImageEdit")
    b.Initialize(File.DirRootExternal & "/ImagenesAvl/","IMG_20178108230.jpg")
    cv1.drawBitmap(b)
    cv1.Mode = cv1.MODE_DRAW
    cv1.PaintStrokeColor = Colors.Red
    cv1.PaintStrokeWidth = 10
End Sub

Sub btnLimpiar_Click
    cv1.undo
End Sub
 

rscheel

Well-Known Member
Licensed User
Longtime User
I already solved it, thanks.

B4X:
Sub btnGuardar_Click
    C.Initialize2(cv1.Bitmap)
    Out = File.OpenOutput(File.DirRootExternal & "/ImagenesAvl/", "IMG_20178108230.jpg", False)
    C.Bitmap.WriteToStream(Out, 100, "JPEG")
    Out.Close
End Sub
 
Upvote 0
Top