corner radius on image object

57 views
Skip to first unread message

tenagak...@gmail.com

unread,
Jul 1, 2018, 3:15:20 AM7/1/18
to DroidScript
How to set a corner radius or border radius in an image object?

thanks in advance.

alex.symbroson

unread,
Jul 1, 2018, 3:36:37 AM7/1/18
to DroidScript
There's the possibility to crop an image in any patter on a binary image with the "src_in" option. So you can draw a white round rectangle on a black image and then draw your source image on it with the src_in option. That should work

Regards

tenagak...@gmail.com

unread,
Jul 1, 2018, 8:38:47 AM7/1/18
to DroidScript
sorry alex, how to use src_in option?

alex.symbroson

unread,
Jul 1, 2018, 8:42:10 AM7/1/18
to DroidScript
Just as I explained - draw a black-white image, and draw your src image on it with "src_in" as options parameter. Play a bit around with it and you'll understand

BareK

unread,
Jul 1, 2018, 9:05:28 AM7/1/18
to DroidScript
Great tip Alex, learned sth! :)
Here's an exemple (I'll attach the image I used to the post):

function OnStart()
{  
   
var lay = app.CreateLayout( "Linear", "FillXY,VCenter" );
   
   
var imgRound = app.CreateImage( "Img/roundedRect.png", 0.2, -1 );
    lay
.AddChild( imgRound );
   
   
var img = app.CreateImage( "/Sys/Img/BlueBack.jpg", 0.2, -1 );
    imgRound
.DrawImage( img, 0, 0, 1.0, -1, 0, "SRC_IN" );
   
    app
.AddLayout( lay );
}


Reply all
Reply to author
Forward
0 new messages