Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Dragging a big image in a smaller "canvas"

For general discussion related FlowStone

Dragging a big image in a smaller "canvas"

Postby kortezzzz » Sun Jul 08, 2018 9:00 am

Hi,

My question is about a very simple feature you'll probably find in the android\web world.
Lets say we've determined an image "canvas" in FS with a size of 200X200 pxls. Now, we are loading in to it a 400X400 pxls image. I need a mouse feature that allows me to drag to the left\right\down\up to see the hidden parts of the image. Does anyone knows how to do it?

Thnaks :)
User avatar
kortezzzz
 
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Dragging a big image in a smaller "canvas"

Postby nix » Sun Jul 08, 2018 10:54 am

I have done this before in a piano roll.
I think you will best start by hooking it up to sliders-
imo start there mate,
and then you can use the mouse over on the image itself
I can up the piano roll if you like, actually- here 'tis->
DS_RC2017.fsm
(371.92 KiB) Downloaded 963 times

I think this is for 3081
The view scroll is the slider on the left of grid
User avatar
nix
 
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: Dragging a big image in a smaller "canvas"

Postby Nubeat7 » Sun Jul 08, 2018 1:45 pm

here is a zoom and scroll bitmap window i did a while ago..
Attachments
zoom sxroll.fsm
(586.65 KiB) Downloaded 933 times
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: Dragging a big image in a smaller "canvas"

Postby kortezzzz » Sun Jul 08, 2018 3:51 pm

Thanks guys, those are great examples and a great starting points, but I ment scrolling without extra sliders. Only with mouse cursor. I mean like every time you point the image and push the cursor+left button pressed, the whole image moves to the dragged direction.
User avatar
kortezzzz
 
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Dragging a big image in a smaller "canvas"

Postby martinvicanek » Sun Jul 08, 2018 8:00 pm

Here is a very basic hand tool. No boundary checking etc., just plain click&drag. Can you take it from there?
Attachments
MovableBitmapDisplay.fsm
(4.05 KiB) Downloaded 889 times
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Dragging a big image in a smaller "canvas"

Postby kortezzzz » Mon Jul 09, 2018 7:57 am

martinvicanek wrote:Here is a very basic hand tool. No boundary checking etc., just plain click&drag. Can you take it from there?


That's great martin :) Thanks.

No success with determining the bounderies. Can you please explain how?
User avatar
kortezzzz
 
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Dragging a big image in a smaller "canvas"

Postby tulamide » Mon Jul 09, 2018 8:45 am

martinvicanek wrote:Here is a very basic hand tool. No boundary checking etc., just plain click&drag. Can you take it from there?
Wow, Martin! You've evolved a lot since the early days. Keep it going!

I corrected a few bits, used syntax and style according to the style guide and added boundary checks. Now some people in the past have reacted strangely, so if you don't want me to correct your code, just say so. It will spare me the work, and I won't mind it.
Attachments
MovableBitmapDisplay[Martin, tulamide].fsm
(11.9 KiB) Downloaded 968 times
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Dragging a big image in a smaller "canvas"

Postby RJHollins » Mon Jul 09, 2018 9:01 am

Works real nice Tulamide.
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm

Re: Dragging a big image in a smaller "canvas"

Postby tulamide » Mon Jul 09, 2018 11:09 am

RJHollins wrote:Works real nice Tulamide.

Thanks! But I've only added the boudary checks, the rest is Martin's work!
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Dragging a big image in a smaller "canvas"

Postby kortezzzz » Mon Jul 09, 2018 1:25 pm

Thanks tulamide, it works perfectely :D

tulamide wrote:I corrected a few bits, used syntax and style according to the style guide and added boundary checks. Now some people in the past have reacted strangely, so if you don't want me to correct your code, just say so. It will spare me the work, and I won't mind it.


Why should anyone refuse to such a possitive tribute? If someone already decided to shares something, what's the point in refusing to customizing it or even improving it? that's one of the forum's best benefits :roll:
Please guys, don't push us into that dirrection.

Thanks!!! :)
User avatar
kortezzzz
 
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Next

Return to General

Who is online

Users browsing this forum: Google [Bot] and 74 guests