C cloner7801 Active Member Licensed User Longtime User Feb 1, 2017 #1 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?
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 Feb 2, 2017 #2 You can use Canvas.DrawView to draw the panel. This sub is useful for creating a canvas: Code: Copy '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
You can use Canvas.DrawView to draw the panel. This sub is useful for creating a canvas: Code: Copy '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
C cloner7801 Active Member Licensed User Longtime User Feb 10, 2017 #3 I dont no why I cant save panel as bitmap @Erel please help me and share a source code Upvote 0
JanPRO Well-Known Member Licensed User Longtime User Feb 10, 2017 #4 I have tried with Code: Copy 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
I have tried with Code: Copy 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