Sep 21, 2016 Replies: 3 Enjoy this library https://github.com/vipulasri/Layout-to-Image from B4A Android Layout (Relative Layout, Linear Layout etc) to Image LayoutToImage Author: SMM Version: 0.01 LayoutToImage Methods: Initialize LayoutToImage (view As View) As Bitmap Sample Code: Copy Dim lti As LayoutToImage lti.Initialize myimageview.SetBackgroundImage(lti.LayoutToImage( Activity)) I tested it on Activity and it worked . On a wrapped view the application crashed Version 2 : Removed @ActivityObject annotation : Thanks @DonManfred Attachments LayoutToImage.zip LayoutToImage.zip 2.2 KB · Views: 464 LayoutToImage2.zip LayoutToImage2.zip 2.1 KB · Views: 508 Last edited: Sep 21, 2016 Click to expand...
Enjoy this library https://github.com/vipulasri/Layout-to-Image from B4A Android Layout (Relative Layout, Linear Layout etc) to Image LayoutToImage Author: SMM Version: 0.01 LayoutToImage Methods: Initialize LayoutToImage (view As View) As Bitmap Sample Code: Copy Dim lti As LayoutToImage lti.Initialize myimageview.SetBackgroundImage(lti.LayoutToImage( Activity)) I tested it on Activity and it worked . On a wrapped view the application crashed Version 2 : Removed @ActivityObject annotation : Thanks @DonManfred
DonManfred Expert Licensed User Longtime User Sep 21, 2016 #2 somed3v3loper said: On a wrapped view the application crashed Click to expand... Did you add @ActivityObject annotation to your lib-source?
somed3v3loper said: On a wrapped view the application crashed Click to expand... Did you add @ActivityObject annotation to your lib-source?
somed3v3loper Well-Known Member Licensed User Longtime User Sep 21, 2016 #3 DonManfred said: Did you add @ActivityObject annotation to your lib-source? Click to expand... You are right , I will upload a new version with ActivityObject removed . Thanks
DonManfred said: Did you add @ActivityObject annotation to your lib-source? Click to expand... You are right , I will upload a new version with ActivityObject removed . Thanks
somed3v3loper Well-Known Member Licensed User Longtime User Sep 21, 2016 #4 DonManfred said: Did you add @ActivityObject annotation to your lib-source? Click to expand... It did not help in fixing crash Code: Copy java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
DonManfred said: Did you add @ActivityObject annotation to your lib-source? Click to expand... It did not help in fixing crash Code: Copy java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference