ScreenCapture with SmartWindowRefresh & Frame3D :)

Everything else that doesn't fall into one of the other PB categories.
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

ScreenCapture with SmartWindowRefresh & Frame3D :)

Post by Dare »

First, this is not a bug as the docs advise to use SmartWindowRefresh with caution.

Funny stuff if using SmartWindowRefresh with a Frame3D gadget with any flag set (flat, single, double). On my system it can be used to do a screen capture (no save, though) if placed correctly! :D (It also trashes things a bit if the window gets moved behind another, and only happens with Frame3D and flags on my box).

Code: Select all

OpenWindow(0, 10,10, 520,390, "title",#PB_Window_Invisible|#PB_Window_SystemMenu|#PB_Window_MinimizeGadget)
CreateGadgetList(WindowID(0))
SmartWindowRefresh(0,#True)    ; <- Screen capture place to be :)
Frame3DGadget(0,1,1,518,388,"",#PB_Frame3D_Flat)
HideWindow(0,#False)
;SmartWindowRefresh(0,#True)    ; <- no capture here (move behind another window still a prob).
Repeat
  evWin = WaitWindowEvent()
  If evWin = #PB_Event_CloseWindow
    done = #True
  EndIf
Until done
Just trivia - And yes, it is pointless to use it in the above code, just illustrating.

:D
Dare2 cut down to size
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

I must confess I don't know what you mean by doing a screen capture. Could you elaborate a bit for a stunned bunny?
BERESHEIT
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

What happens when you run the above code?

With me, the created window client looks transparent, but when you drag it, you find it was painted with (captured) the area behind the client area.

You don't get that result?
Dare2 cut down to size
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Sorry, I didn't try it. Now I did and I see what you mean. It's neat to run it and move the window half off the screen and in a bit of a circular motion, it gets all garbled. It reminds me of the time an STS tech came in to service some tape drives at our datacenter and he waved his mechanic's magnet in front of a CRT and made it go all woozy. He took it away and it went back to normal. It was an IBM monochrome terminal. My colleague Dave was really impressed. He grabbed the magnet and went up to a five-thousand-dollar color 4-screen monitor where this girl he liked was working and repeated the trick to impress her. He waved it grandly around, woozing up the display something awful and then he took it away. He said, "And now..." and waited a few seconds. NOTHING happened. It just stayed that way. You never saw such a look on a human face in your life! Some time later the IBM tech came in and saw it. He said, "Holy sh.. - What the hell happened to that?" Somebody said, "It just went that way all at once." There was a minutes' silence and then he said, "Huh. Weird. Are you sure nobody brought a magnet or something near it?" Dead Silence.
BERESHEIT
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

lol. :D

And ouch.
Dare2 cut down to size
Post Reply