Android Question (solved)How to create buttons in the picture

Theera

Expert
Licensed User
Longtime User
Refer to this Assume I have a picture which has more frames, I would like to add the button on each frame, how to do that?, please.
 
Solution
B4J version:
1756461110633.png

I assume that this is what you would like to do, right?
The image is set as a background to the pnimage pane (B4J).
When you click on the "Show buttons" button the buttons are shown on the pane.
Clicking on one of the buttons (b0 to b5) will show which button is clicked.
You can use the "Remove buttons" to remove the buttons from the pnimage pane.
You can find the source code in the attachment (testenvironment103.zip)
You can also use labels in stead of the buttons.
If you want to use an imageview then put a transparent pnimage pane on top of the imageview.

PaulMeuris

Well-Known Member
Licensed User
B4J version:
1756461110633.png

I assume that this is what you would like to do, right?
The image is set as a background to the pnimage pane (B4J).
When you click on the "Show buttons" button the buttons are shown on the pane.
Clicking on one of the buttons (b0 to b5) will show which button is clicked.
You can use the "Remove buttons" to remove the buttons from the pnimage pane.
You can find the source code in the attachment (testenvironment103.zip)
You can also use labels in stead of the buttons.
If you want to use an imageview then put a transparent pnimage pane on top of the imageview.
 

Attachments

  • testenvironment103.zip
    240.8 KB · Views: 15
Upvote 0
Solution

Theera

Expert
Licensed User
Longtime User
Many thanks again, PaulMeuris.I think I found my target strategy that is using tiles_JE
 
Upvote 0

Theera

Expert
Licensed User
Longtime User
B4J version:
View attachment 166399
I assume that this is what you would like to do, right?
The image is set as a background to the pnimage pane (B4J).
When you click on the "Show buttons" button the buttons are shown on the pane.
Clicking on one of the buttons (b0 to b5) will show which button is clicked.
You can use the "Remove buttons" to remove the buttons from the pnimage pane.
You can find the source code in the attachment (testenvironment103.zip)
You can also use labels in stead of the buttons.
If you want to use an imageview then put a transparent pnimage pane on top of the imageview.
You are genius man, your code is exciting for me.
 
Upvote 0

PaulMeuris

Well-Known Member
Licensed User
Bonus 1:
1756626733309.png

When you click on the Show views button the labels at the bottom appear.
You can drag a label onto the pnimage pane and move it around to its place.
When you right click on the label it will be removed from its parent (pnimage pane or pnlabels pane)
With the Show/hide snapshot you can look at a snapshot of the image.
1756627088180.png

You can find the source code (testenvironment103_B4J) in the attachment together with the libraries that were used.
 

Attachments

  • DragAndDrop2.b4xlib
    6.5 KB · Views: 3
  • testenvironment103_B4J.zip
    242.2 KB · Views: 3
  • ZoomImageView.b4xlib
    2.7 KB · Views: 4
Upvote 0

Theera

Expert
Licensed User
Longtime User
Bonus 1:
View attachment 166452
When you click on the Show views button the labels at the bottom appear.
You can drag a label onto the pnimage pane and move it around to its place.
When you right click on the label it will be removed from its parent (pnimage pane or pnlabels pane)
With the Show/hide snapshot you can look at a snapshot of the image.
View attachment 166453
You can find the source code (testenvironment103_B4J) in the attachment together with the libraries that were used.
Thank you for kind of you.Your apps are interesting.
 
Upvote 0

PaulMeuris

Well-Known Member
Licensed User
Bonus 2: the B4A version (Samsung device with One UI 7.0 and Android version 15)
1756627850353.png

To put a label on the image panel you tap on the label first and then tap and drag on the image to put the label in its place.
If you tap on a label that is on the image a message is shown and then you can move it by tapping and dragging on the image.
You can switch on the snapshot to zoom in on the image.
1756628185231.png

A long tap removes the label.
You can find the source code (testenvironment103_B4A) in the attachment together with the ZoomImageView library.
 

Attachments

  • testenvironment103_B4A.zip
    249.2 KB · Views: 3
  • ZoomImageView.b4xlib
    2.7 KB · Views: 4
Upvote 0
Top