drracket icon indicating copy to clipboard operation
drracket copied to clipboard

Investigate automation of screenshot capture as part of documentation build process?

Open spdegabrielle opened this issue 5 years ago • 4 comments

ref #172 @rfindler update Drracket documentation: Investigate automation of screenshot capture as part of documentation build process?

spdegabrielle avatar Aug 02 '19 11:08 spdegabrielle

Hi Stephen,

I offer the following piece to the puzzle:

https://gist.github.com/soegaard/019d30cfed891b1899b9

(I tested it right now in DrRacket 7.3 and it still works)

/Jens Axel

Den fre. 2. aug. 2019 kl. 13.12 skrev Stephen De Gabrielle < [email protected]>:

ref #172 https://github.com/racket/drracket/pull/172 @rfindler https://github.com/rfindler update Drracket documentation: Investigate automation of screenshot capture as part of documentation build process?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/racket/drracket/issues/295?email_source=notifications&email_token=AADQXRKRVJDW3D6HUJHAM5TQCQJABA5CNFSM4II4ZV42YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HDBENJQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AADQXRMVJX3LLMBFBWOUI23QCQJABANCNFSM4II4ZV4Q .

--

Jens Axel Søgaard

soegaard avatar Aug 02 '19 11:08 soegaard

Thank you @soegaard

spdegabrielle avatar Aug 02 '19 14:08 spdegabrielle

Is it possible to go from the result of get-handle to something that that screenshot code can use, @soegaard ?

rfindler avatar Aug 05 '19 14:08 rfindler

@rfindler

Better late than never. I seem to have missed the message above.

Here is an updated version of the script that works with DrRacket 8.10. Note: Remember to allow "Screen recordings" for DrRacket in the system preferences.

It shows:

  • how to capture an entire screen
  • how to capture a single window
  • how to recreate the widget gallery
image

The function (capture-window-with-name rx) takes a regular expression rx and captures the first window that has a name that matches.

Since the result of get-handle is a cairo_surface_t (which represents some drawing surface like bitmaps or canvases), I don't see how the screenshot functions can use a handle.

soegaard avatar Sep 23 '23 15:09 soegaard