Hi all,
having some spare time before my next meeting I downloaded class BitmapCreatorEffects to play with its nice effects.
DrawThroughMask soon captured my attention since it allows a nice effect I programmed in the old DOS days.
I'd like not to use images for background and mask as in the given example. So I tried to use a couple of labels, taking snapshots of each then calling the effect routine passing those B4xBitmaps as arguments and a B4xView as the destination object.
Unfortunately, I can see the background as is, but not the mask applied to it. So my question is: should I use any special setting for the mask ( I tried transparency to no avail).
This is the quick and dirty code I tried so far:
I even tried an additional and final imgChar.Update, but nothing. Ok, 4PM meeting is approaching..I'll try again later..
having some spare time before my next meeting I downloaded class BitmapCreatorEffects to play with its nice effects.
DrawThroughMask soon captured my attention since it allows a nice effect I programmed in the old DOS days.
I'd like not to use images for background and mask as in the given example. So I tried to use a couple of labels, taking snapshots of each then calling the effect routine passing those B4xBitmaps as arguments and a B4xView as the destination object.
Unfortunately, I can see the background as is, but not the mask applied to it. So my question is: should I use any special setting for the mask ( I tried transparency to no avail).
This is the quick and dirty code I tried so far:
B4X:
Dim mytext As String = "I LOVE YOU"
Dim sb As StringBuilder
sb.Initialize
For i = 0 To 50
sb.Append(mytext)
Next
lblSentence.Text = sb.ToString
lblSentence.TextSize = 10
lblSentence.Color = xui.Color_White
lblSentence.TextColor = xui.Color_Black
lblChar.Text = "K"
'lblChar.TextColor = xui.Color_Transparent
lblChar.Color = xui.Color_White
effects.Initialize
OriginalBmp = lblSentence.Snapshot
Dim mask As B4XBitmap = lblChar.Snapshot
mask = mask.Resize(OriginalBmp.Width, OriginalBmp.Height,False)
'Dim mask As B4XBitmap = xui.LoadBitmapResize(File.DirAssets, "mask.png", OriginalBmp.Width, OriginalBmp.Height, False) <-- this one works OK
imgChar.SetBitmap(effects.DrawThroughMask(OriginalBmp, mask))
I even tried an additional and final imgChar.Update, but nothing. Ok, 4PM meeting is approaching..I'll try again later..