iOS Question save panel as bitmap

cloner7801

Active Member
Licensed User
Longtime User
Hi,
Can you help me how to save panel as bitmap?
I have 3 view in a panel and I want to save panel as bitmap and then save it in gallery
Can you send me a snippet?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can use Canvas.DrawView to draw the panel.

This sub is useful for creating a canvas:
B4X:
'don't forget to release when done
Public Sub CreateCanvas (width1 As Int, height1 As Int) As Canvas
   Dim iv As ImageView
   iv.Initialize("")
   iv.SetLayoutAnimated(0, 1, 0, 0, width1, height1)
   Dim c As Canvas
   c.Initialize(iv)
   Return c
End Sub
 
Upvote 0

JanPRO

Well-Known Member
Licensed User
Longtime User
I have tried with
B4X:
Sub CreateBitmap(V As View) As Bitmap
    Dim C As Canvas
    C.Initialize(V)
    Dim Bitm As Bitmap = C.CreateBitmap
    C.Release
    Return Bitm
End Sub

works fine.

Jan
 
Upvote 0
Top