Image follow touch position

squaremation

Active Member
Licensed User
Longtime User
I not sure how to word this for a search, I have been trying. What I want to do is have a image view that moves with user touch. Basically you touch the image/label and it moves with your finger until release.



:sign0104:
 

squaremation

Active Member
Licensed User
Longtime User
Maybe what you're looking for is TouchImageView

I did view this but this seems only capable of zoom/resize the image. I wish to move/drag the image wherever the user's finger is until it is released.
 
Last edited:
Upvote 0

pluton

Active Member
Licensed User
Longtime User
You are looking drag function if I understand

Here in this post is example of label. When you press and drag a label all over the screen.
Drag a label example

It will be easy for you to make it to drag a image.
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
I did view this but this seems only capable of zoom/resize the image. I wish to move/drag the image wherever the user's finger is until it is released.

TouchImageView can do exactly what you want.

You can set it's Bitmap property - pass a Bitmap.
Then set both MinScale and MaxScale to 1 and you'll have a draggable Bitmap which cannot be zoomed in or out.

http://www.b4x.com/forum/additional-libraries-official-updates/15616-touchimageview-3.html#post90086

You can see from that post that someone else also wanted a draggable but not zoomable version.
I shall make time to update the library and either add an option to disable zooming or create a new draggable but not zoomable library.

Martin.
 
Upvote 0

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I did view this but this seems only capable of zoom/resize the image. I wish to move/drag the image wherever the user's finger is until it is released.

The attached sounds like what you are looking for. It doesn't use any external libraries.

I found this in my B4A folder, but I don't remember where it came from and I couldn't find it on here by searching. Maybe whoever wrote it will recognize it and claim it.
 

Attachments

  • MovingBitmap.zip
    6.4 KB · Views: 797
Upvote 0

squaremation

Active Member
Licensed User
Longtime User
@pluton, warwound, nfordbscndrd :sign0098:

Thanks for thnx for the examples!

I am toying around with which I can use in a game and be interactive with another layer or a position on the screen.

This will get me started in the right direction. I know what I'm attempting is probably not difficult to the experts here, but I'll learn a lot trying to get this done. :sign0104:
 
Upvote 0
Top