B4A Library Layout-to-Image

Enjoy this library https://github.com/vipulasri/Layout-to-Image from B4A

Android Layout (Relative Layout, Linear Layout etc) to Image
header.png



LayoutToImage
Author:
SMM
Version: 0.01
  • LayoutToImage
    Methods:
    • Initialize
    • LayoutToImage (view As View) As Bitmap


Sample
B4X:
    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
    2.2 KB · Views: 180
  • LayoutToImage2.zip
    2.1 KB · Views: 214
Last edited:

somed3v3loper

Well-Known Member
Licensed User
Longtime User
Did you add @ActivityObject annotation to your lib-source?
It did not help in fixing crash
B4X:
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
 
Top