Android Question Stickerview2

demasi

Active Member
Licensed User
Longtime User
Hello,
I'm posting this as new thread because the original thread is too old. I'm trying to use StickerView2 library, when I run the example app with b4a 6 and Android 6 the example behaves different from the vídeo. Its a different program, I know, but when I add new stickers the handles of the other stickers are showed too. How can I do to show only the handles of the selected sticker, and If no one is selected do not show any handles.
Other thing, how can I save the final result of the image to a jpg filé?
Thank you.
 

DonManfred

Expert
Licensed User
Longtime User
See the sub
B4X:
Sub AddSticker_Click()
    Dim Sticker1 As StickerView
    Dim cat As Bitmap
    cat.Initialize(File.DirAssets,"ic_cat.png")
   
    Sticker1.Initialize("Sticker")
    Sticker1.Bitmap = cat

    Activity.AddView(Sticker1,0,0,100%x,100%y)   
   
End Sub
in the example. It shows you how to add another Sticker.

how can I save the final result of the image to a jpg filé?
There is no method for this in the Githubproject. So; you can´t.
 
Upvote 0

demasi

Active Member
Licensed User
Longtime User
Hello, Don Manfred. Congrats for your fantastic lib.
Yes, I did as in your example to add new stickers.
What I'm asking is how I can disable the four handlers of the unselected stickers, as show in your example video.
e.g.: I add one sticker, it have the handles. I add another sticker, the first have to disable its handles, but what happens is that all stickers I add stay with the handles.
The app in your video works ok.
Thank you for your answer.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
What I'm asking is how I can disable the four handlers of the unselected stickers, as show in your example video.
You need to set all others stickers in the InEdit = false and the Active should be InEdit = true

Be inspired by this code

B4X:
Sub Sticker_onEdit()
    Dim sticker As StickerView = Sender ' Active Sticker
    For Each v As View In Activity.GetAllViewsRecursive
        If v Is StickerView Then
            Dim stick As StickerView = v ' get the Sticker into a StickerView object and set it to InEdit false
            stick.InEdit = False
        End If
    Next
    ' As we did changed ALL Stickers (even the active one)
    ' we set the active Sticker (see above) to InEdit = true
    sticker.InEdit = True '
End Sub

Make sure all your Sticker have the Eventname set to "Sticker" for this sub signature
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Other thing, how can I save the final result of the image to a jpg filé?
Once you know (you now should :D) how to disable the Edit-Points from all Stickers.

I suggest to use a Menuitem to start a sub which will:
Set all Stickers to InEdit = false

Take a Screenshot programatically from your Activity (or Panel where the Stickers are)
 
Upvote 0

demasi

Active Member
Licensed User
Longtime User
Yes, you got the point. This is what I need.
Thank you for your examples.
One more question about your library: what is a BubbleTextView and a BubbleInputDialog?
 
Upvote 0

demasi

Active Member
Licensed User
Longtime User
Sure! I looked at the github and found that this is a text baloon.
Thank you.
 
Upvote 0
Top