Java Question [solved ]b4a bitmap to library android.graphics.Bitmap

Discussion in 'Libraries developers questions' started by MarkusR, Apr 14, 2018.

  1. MarkusR

    MarkusR Well-Known Member Licensed User

    maybe someone had done this.

    i need to give my library a bitmap from b4a

    library part:
    Code:
    public Texture(android.graphics.Bitmap Bitmap1)
        {
            this.Bitmap1 =Bitmap1;
        
    }
    b4a part:
    Code:
    Dim bmp As Bitmap = LoadBitmap(File.DirAssets,"wood.png")
    Cube1.SetTexture(bmp)
     
  2. MarkusR

    MarkusR Well-Known Member Licensed User

    i have plan b, i using byte array or inputstream for the image file.
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Why?

    The code you posted should work (after you fix the Texture method signature to:
    Code:
    public void SetTexture(android.graphics.Bitmap Bitmap1)
     
    MarkusR likes this.
  4. MarkusR

    MarkusR Well-Known Member Licensed User

    @Erel,
    omg, yes, it was just because both side know Bitmap :)
    your advice work very well. thank you very much.

    correct in library
    Code:
    public void SetTexture(android.graphics.Bitmap Bitmap1)
    wrong in library
    Code:
    public void SetTexture(Bitmap Bitmap1)
     
    DonManfred likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice