*SCREENSAVE - NOT!

Discussions related to graphics (2D and 3D), animation and games programming
KenDown
Posts: 327
Joined: Wed 04 Apr 2018, 06:36

*SCREENSAVE - NOT!

Post by KenDown »

For various reasons I have a picture in one window and an animation overlaying it in a transparent window. When the animated text finished I used *SCREENSAVE to save the result, only to discoverthat all I had was the picture! It would appear that *SCREENSAVE is actually *WINDOWSAVE.

Am I overlooking something? (Which is not at all impossible.)
DDRM

Re: *SCREENSAVE - NOT!

Post by DDRM »

Hi KenDown,

The manual says it saves BASIC's output window (presumably the currently selected one if you have more than one) - I guess it uses the bitmap associated with @hwnd%.

Can you save your two images independently? Would that allow you to solve your problem?

You could use alt-printscreen to grab a copy manually, which might capture both layers - it captures "the window", but I'm not sure if that means it literally, as it apparently does in BB4W, or whether it captures the area of the display where the window sits . Presumably just "print screen" on its own would capture both layers, but also everthing around your window, which you'd then need to crop. As I understand it. but copy to the clipboard, from where you would be able to load and process it.

If you just need a single image showing the output using the Windows shortcuts is probably the simplest solution. If you need a programmatic solution, it may be trickier. If you can work it out, please let us know! Otherwise I might be able to have a play sometime...

Best wishes,

D
KenDown
Posts: 327
Joined: Wed 04 Apr 2018, 06:36

Re: *SCREENSAVE - NOT!

Post by KenDown »

Yes, I saw the phrase "output window" in the manual, which just underlines my grumble that *SCREENSAVE should be renamed *WINDOWSAVE!

The output has to come from within the program, which outputs the picture and names is, then increments the name (001.bmp, 002.bmp, etc). Alt+PrintScr is not really an option. Combining two grabs might be possible - if I knew how to do that! How does one combine one bmp with the contents of another?

Oh well.

Thanks for your reply, anyway.
User avatar
hellomike
Posts: 192
Joined: Sat 09 Jun 2018, 09:47
Location: Amsterdam

Re: *SCREENSAVE - NOT!

Post by hellomike »

Would the information from the following help you out further?
http://www.bbcbasic.co.uk/wiki/doku.php ... screensave

Cheers
p_m21987
Posts: 177
Joined: Mon 02 Apr 2018, 21:51

Re: *SCREENSAVE - NOT!

Post by p_m21987 »

Hello,

I'm pretty sure "screensave" got its name from the *screensave command from Acorn Archimedes/RISC OS computers. On that system the command grabs the whole screen.

The name has presumably not been changed for compatibility or consistency with Acorn basic & RISC OS.

PM
KenDown
Posts: 327
Joined: Wed 04 Apr 2018, 06:36

Re: *SCREENSAVE - NOT!

Post by KenDown »

Thanks. They look like useful routines, but unfortunately they don't do the job, not even the PROC_CaptureScreenWithMousePointer(_file$), which looked the most promising. They all just saved the contents of the main window and did not save the text in the transparent window which overlays the main window.

Gosh! You would think it a simple matter to just save screen memory - no problems with BBC Micro! Clearly we have gone backwards, not forwards!
KenDown
Posts: 327
Joined: Wed 04 Apr 2018, 06:36

Re: *SCREENSAVE - NOT!

Post by KenDown »

Thanks Patrick. Yes, I'm aware of the BBC ancestry of the command. It's just annoying that it doesn't do what the Beeb did with the command or what the command itself implies! I wonder if there's any mileage in just reading each pixel on the screen and saving it to a file? But then, would that be any sort of recognised format that could be handled by a graphics program?

Hmmmm.
p_m21987
Posts: 177
Joined: Mon 02 Apr 2018, 21:51

Re: *SCREENSAVE - NOT!

Post by p_m21987 »

Gosh! You would think it a simple matter to just save screen memory - no problems with BBC Micro!
I'm not an expert, but I can see how it could be much more straightforward back on the old Acorn computers, but a lot trickier on modern computers with memory protection and different operating systems with different APIs available.

I'm not sure what could be done on windows, but on Linux, you could use OSCLI to run "scrot -uz file.bmp" to save the currently active window to a bitmap file, which you could then *DISPLAY.

PM
KenDown
Posts: 327
Joined: Wed 04 Apr 2018, 06:36

Re: *SCREENSAVE - NOT!

Post by KenDown »

Er - but that is the problem. I have no problem saving the contents of the current window; it's the contents of the transparent window overlying the current window that is the problem.

To repeat: I have a picture in the current window. Over the top of that I have a transparent window in which is a line of text doing clever things. When it finishes I want to save the complete screen - picture plus text on top of it. All the solutions so far suggested (plus, of course, *SCREENSAVE itself) simply saves the picture, no text.
p_m21987
Posts: 177
Joined: Mon 02 Apr 2018, 21:51

Re: *SCREENSAVE - NOT!

Post by p_m21987 »

I did understand what you want. To clarify, 'scrot' would take a screenshot of what's being displayed on the screen which should include your transparent window (if the transparent window is visible and 'above' your bbc basic window). Selecting the current window (which I assume is the bbc basic program's window) just crops the screenshot so it only captures the area covered by the window you're capturing.

Here is an example of what I mean:
Image
http://dusthillguy.ddns.net/folder/file ... _scrot.png