Page 2 of 2

Re: Cursor during image movement?

Posted: Tue Nov 15, 2022 8:20 pm
by SparkOut
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.

Re: Cursor during image movement?

Posted: Tue Nov 15, 2022 9:18 pm
by dunbarx
I miss Hermann.

Craig

Re: Cursor during image movement?

Posted: Tue Nov 15, 2022 9:28 pm
by dunbarx
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

Re: Cursor during image movement?

Posted: Tue Nov 15, 2022 9:53 pm
by Klaus
Some of Hermanns work can still be found here: https://hh.on-rev.com/html5/index-large.html

Re: Cursor during image movement?

Posted: Tue Nov 15, 2022 10:42 pm
by SparkOut
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

Re: Cursor during image movement?

Posted: Wed Nov 16, 2022 12:12 am
by dunbarx
Hi.

No keyhole. No sure what keyword would make sense.

Craig

Re: Cursor during image movement?

Posted: Wed Nov 16, 2022 9:16 am
by SparkOut
The second link in the post above goes straight to the point in Hermann's thread I found using Keyhole as search term.

Re: Cursor during image movement?

Posted: Wed Nov 16, 2022 9:23 am
by Zax
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.

Re: Cursor during image movement?

Posted: Wed Nov 16, 2022 10:00 am
by richmond62
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.

Re: Cursor during image movement?

Posted: Wed Nov 16, 2022 10:57 am
by Zax
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 6386 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 :(

Re: Cursor during image movement?

Posted: Wed Nov 16, 2022 12:37 pm
by richmond62
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.

Re: Cursor during image movement?

Posted: Wed Nov 16, 2022 1:25 pm
by richmond62
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.

Re: Cursor during image movement?

Posted: Wed Nov 16, 2022 2:22 pm
by Zax
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