Can someone tell me how to exactly use the setBoxBackground method, please?

Can someone tell me how to exactly use the setBoxBackground method, please?

]]>

17 Commentsto Can someone tell me how to exactly use the setBoxBackground method, please?

  1. Anonymous says:

    < ![CDATA[

    item.setBoxBackground(image,”nsf”[,true|false]);

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Lol, i inverted string and bitmap xD really thanks!

    ]]>

  3. Anonymous says:

    < ![CDATA[

    OK, it doesn’t work. I guess it needs an image not a bitmap, right?

    ]]>

  4. Anonymous says:

    < ![CDATA[

    Yes

    ]]>

  5. Anonymous says:

    < ![CDATA[

    LL.createImage(width,height).draw().drawBitmap(bitmap,0,0,null)

    ]]>

  6. Anonymous says:

    < ![CDATA[

    How can I convert a bitmap to an image object?


    I create the bitmap using the createBitmap method, but before it was an image object (pickImage method).

    ]]>

  7. Anonymous says:

    < ![CDATA[

    Loool, thou hast anticipated me! Impressive! Thanks again 🙂

    ]]>

  8. Anonymous says:

    < ![CDATA[

    Still have problems, please don’t kill me 🙁


    It’s better if I share directly the code here…


    —————————–


    //Class—————


    LL.bindClass(“android.graphics.Bitmap”);



    //header_var—————


    var header=LL.getCurrentDesktop().getItemByName(“main”).getContainer().getItemByName(“pan_header”).getContainer().getItemByName(“header”);


    var h_width=header.getWidth();


    var h_height=header.getHeight();



    //Image_creation—————


    var img=LL.pickImage(0).getBitmap();


    var img_width=img.getWidth();


    var img_height=img.getHeight();


    var scaled_width=img_width/(img_height/h_height);


    Android.makeNewToast(scaled_width,true).show();


    var img_scaled=Bitmap.createScaledBitmap(img,scaled_width,h_height,true);


    var cut=(scaled_width/2)-(h_width/2);


    var tmp_img=Bitmap.createBitmap(img_scaled,cut,0,h_width,h_height);


    var h_img=LL.createImage(h_width,h_height).draw().drawBitmap(tmp_img,0,0,null)


    img.recycle();


    img_scaled.recycle();


    tmp_img.recycle();



    //header_set_box—————


    var edit=header.getProperties().edit();


    var h_box=edit.getBox(“i.box”);


    header.setBoxBackground(h_img,”nsf”,true);


    edit.commit();


    h_img.recycle();

    ]]>

  9. Anonymous says:

    < ![CDATA[

    In this case you have to do it in two steps : First create the image, then draw on it. Otherwise you can’t keep reference to the image.

    ]]>

  10. Anonymous says:

    < ![CDATA[

    i have to include some other classes or draw method is included in LL api?

    ]]>

  11. Anonymous says:

    < ![CDATA[

    It should be included I think.


    Anyway (and this applies to all scripting code) if you don’t know if of a classes is loaded or not just use it. If it makes a “X is not defined” error then you need to bind it.

    ]]>

  12. Anonymous says:

    < ![CDATA[

    It doesn’t work in no way, and i understood where the problem is:


    when i use the “draw” method, it returns a canvas and then i draw on it the bitmap. But it is still a canvas not an image object, and setBoxBackground accept only image…


    Some other idea? Pierre Hébert what do you think about it?

    ]]>

  13. Anonymous says:

    < ![CDATA[

    Repeat: “In this case you have to do it in two steps : First create the image, then draw on it. Otherwise you can’t keep reference to the image.”



    var img = LL.createImage(…


    img.draw().drawBitmap(…


    …setBoxBackground(img,…

    ]]>

  14. Anonymous says:

    < ![CDATA[

    Lukas Morawietz I already did that, and it didn’t work.



    Always appears the same alert: “Cannot find call method setBoxBackground(b.a.b.ej,string,boolean)”.



    I already said why (in my opinion) it doesn’t work in my previous comment

    ]]>

  15. Anonymous says:

    < ![CDATA[

    Code above works for me.

    ]]>

  16. Anonymous says:

    < ![CDATA[

    Please post your current code. (or update above and tell)

    ]]>

  17. Anonymous says:

    < ![CDATA[

    Lukas Morawietz​ you was right, it works perfectly.


    I made a mistake:


    var IMG_tmp=LL.createImage(…);


    Var IMG=IMG_tmp.draw().drawBitmap(…);


    Item.setBoxBackground(IMG…);



    In this way I set as box background the canvas xD



    SORRY for the misunderstanding and really really thanks for your help and patience… 🙂


    How can I repay the lost time?

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *