As stated in this post I need to make an image slider with rounded corners. That catch is that there are some rotated and shaded labels over the images and these should have round corners as well. On this sceendump the label corners are not rounded because only the images themselves are rounded.
The solution I found worked best is to simply overlay the whole bunch with a transparent mask as shown below:
Now, this is quite tedious to create and takes a bit trial and error, so how do I create this programmatically?
My guess is that a modified version of CreateRoundRectBitmap should be able to do it.
Sub CreateEdge (BackgroundBitmap As B4XBitmap, TargetView As B4XView)
Dim bc As BitmapCreator
bc.Initialize(TargetView.Width, TargetView.Height)
bc.CopyPixelsFromBitmap(BackgroundBitmap)
bc.DrawRectRounded(bc.TargetRect, xui.Color_Transparent, True, 0, 20dip)
bc.SetBitmapToImageView(bc.Bitmap, TargetView)
End Sub
I'm sorry, I have to write it...
Erel, why are you able to write that code, probably in a couple of minutes or less, but you can't name the file CreateEdge?
?
There is no simple solution for antialiasing in this case. It is related to the way transparent colors are drawn. It will be less noticeable on mobile devices.
Thanks, Erel, it works perfectly. The antialiasing is not a problem at all, you don't notice it on the phone. You have to make a screendump and zoom in to see it.