Cursor during image movement?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

SparkOut
Posts: 2944
Joined: Sun Sep 23, 2007 4:58 pm

Re: Cursor during image movement?

Post by SparkOut » Tue Nov 15, 2022 8:20 pm

Hermann did some lovely stuff like this, one example was a "keyhole" to peep through, and it was draggable to emulate peeping at different angles.
I am not sure where it might be found now, but a search through Hermann's submissions might be valuable.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Cursor during image movement?

Post by dunbarx » Tue Nov 15, 2022 9:18 pm

I miss Hermann.

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Cursor during image movement?

Post by dunbarx » Tue Nov 15, 2022 9:28 pm

Sparkout.

Code: Select all

 but a search through Hermann's submissions might be valuable.
Hermann was in the top group of members in terms of number of posts, over 2200. I don't know how one would search his body of work.

Craig

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Cursor during image movement?

Post by Klaus » Tue Nov 15, 2022 9:53 pm

Some of Hermanns work can still be found here: https://hh.on-rev.com/html5/index-large.html

SparkOut
Posts: 2944
Joined: Sun Sep 23, 2007 4:58 pm

Re: Cursor during image movement?

Post by SparkOut » Tue Nov 15, 2022 10:42 pm

One of the biggest "collections" of Hermann's stuff is in the Raspberry Pi forum, although much of that work is not limited to Raspi, just frequently demonstrating very efficient techniques that the Pi can cope with.
https://forums.livecode.com/viewtopic.php?f=76&t=19248

But it's easy enough to view a list of all Hermann's posts and then within that do a keyword search for "keyhole"

https://forums.livecode.com/viewtopic.p ... 80#p135480

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Cursor during image movement?

Post by dunbarx » Wed Nov 16, 2022 12:12 am

Hi.

No keyhole. No sure what keyword would make sense.

Craig

SparkOut
Posts: 2944
Joined: Sun Sep 23, 2007 4:58 pm

Re: Cursor during image movement?

Post by SparkOut » Wed Nov 16, 2022 9:16 am

The second link in the post above goes straight to the point in Hermann's thread I found using Keyhole as search term.

Zax
Posts: 519
Joined: Mon May 28, 2007 10:12 am
Contact:

Re: Cursor during image movement?

Post by Zax » Wed Nov 16, 2022 9:23 am

dunbarx wrote:
Tue Nov 15, 2022 7:16 pm
When you say "move a hole" do you mean that this moving hole uncovers, to the extent of the hole itself, a portion of an image that sits below a blank white image or control? That the "hole" is a moving window "through" that white image?
This is a "hole" (though not yet well done):

screen.jpg

It's for an experimental graphic tool for my own use.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: Cursor during image movement?

Post by richmond62 » Wed Nov 16, 2022 10:00 am

That is a well-explored path, having done that in 2001.

BUT, I thought you wanted a hole in a mask over other things all in a single stack.

The easiest way to do this is to have an image twice the width and twice the height if the stack made as a PNG with a transparent hole and imported into LiveCode.

Zax
Posts: 519
Joined: Mon May 28, 2007 10:12 am
Contact:

Re: Cursor during image movement?

Post by Zax » Wed Nov 16, 2022 10:57 am

richmond62 wrote:
Wed Nov 16, 2022 10:00 am
That is a well-explored path, having done that in 2001.
Glad to hear, because I encounters some strange behaviors of "import snaphot" command. Not sure I've well understood this powerful command.

My problems are:
1 - the "toolbar" must always be visible at the top of the stack
screen2.jpg
screen2.jpg (7.37 KiB) Viewed 4684 times
2 - the stack is resizable (so its size changes!)
3 - the hole must also be resizable. I don't know to manage this point with a single big png image. At this time, I have a large png image for the hole itself and the dark margins are made with 4 flat rectangles graphics.

Maybe there is a way to create on the fly a single image with alpha and a mask for the hole in LC? I mean an efficient way, not dealing with the imagedata and maskdata that would take too much time.


EDIT: Google sent me to this old message:
https://www.mail-archive.com/search?l=u ... newest&f=1
but I don't understand anything :(

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: Cursor during image movement?

Post by richmond62 » Wed Nov 16, 2022 12:37 pm

Well, this is about as goofy as it gets:
-
Screen Shot 2022-11-16 at 1.34.17 PM.png
-
Screen Shot 2022-11-16 at 1.34.38 PM.png
-
Because, as you can see, the hole ends up the same shape as the stack.

Currently playing "Our English Teacher Was A Driller Killer" mounting monitors on a board for wall attachment . . . thanks, I needed a break. 8)

As you did NOT answer my question, I have assumed that you want a 'hole' inside a stack.

Tell me I am wrong and I shall do something similar for a stack-with-a-hole.
Attachments
peep hole.livecode.zip
Stack.
(87.74 KiB) Downloaded 111 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: Cursor during image movement?

Post by richmond62 » Wed Nov 16, 2022 1:25 pm

One of the ways round a hole that changes shape is to have an enormous mask (say 6000 x 6000) and make sure the hole is always inwith the borders of the resized stack.

Zax
Posts: 519
Joined: Mon May 28, 2007 10:12 am
Contact:

Re: Cursor during image movement?

Post by Zax » Wed Nov 16, 2022 2:22 pm

Sorry Richmond, I was deep in my scripts and didn't see your question. Yes, it is a hole in the stack.

After several tries, I finally found a simpler solution than yours based on the old link I posted - simpler because it doesn't require a big image.
So far, everything is working perfectly :)

it requires :
- a graphic named "Margins"
type = rectangle
opaque = true
backgroundColor = let's say "black"
rect = the rect of the card
blendLevel = 0

- a graphic named "Hole" (it will be the mask)
type = rectangle
opaque = FALSE
rect = the rect of the hole (resizable in my case)
blendLevel = 0
ink = "blendDstIn"

- both rectangles are grouped (named "GpViewer")
blendLevel = 0
ink = "blendSrcOver"


Window shape creation:

Code: Select all

on recreateWindowShape
   templateImageSet // properties of ANY new image
   try
      import snapshot from group "GpViewer" -- with effects
      set the windowShape of this stack to (the id of last img)
      delete last img
   catch errMsg
      answer error errMsg with "Cancel"
   end try
end recreateWindowShape

on templateImageSet
   set the paintCompression to "png" // format de sortie de l'image créée
   set the resizeQuality of the templateImage to "best"
   set the threeD of the templateImage to false
   set the borderWidth of the templateImage to 0
   set the alwaysBuffer of the templateImage to true
end templateImageSet
The transparency of the margins can be modified - before "recreateWindowShape" with:
set the blendLevel of graphic "Margins" to 50
screen.jpg

Post Reply