How to SaveSnapshot with coordinates

Find quick help here to get you started with Hollywood
Post Reply
amyren
Posts: 361
Joined: Thu May 02, 2019 11:53 am

How to SaveSnapshot with coordinates

Post by amyren »

This will save the whole window

Code: Select all

SaveSnapshot(f$, #SNAPDISPLAY, #IMGFMT_PNG)
But how to save just a part of the display, like an area specified by x, y, width, height?
SaveSnapshot does not apear to support coordinates

GrabDesktop does support coordinates, but that would only be usable if using a fullscreen display.
For Android I figured that GrabDesktop could work since it always will be fullscreen, but this GrabDesktop command generate an out of memory error on android.

Code: Select all

GrabDesktop(2, {X = 10, Y = 30, Width = 1400, Height = 720})
Any suggestions on how to do this?
Bugala
Posts: 1181
Joined: Sun Feb 14, 2010 7:11 pm

Re: How to SaveSnapshot with coordinates

Post by Bugala »

You could use CropBrush() or DisplayBrushPart()

Idea being that first take the snapshot, and then make the snapshot into a brush that you can use CropBrush or DisplayBrushPart to make into containing only part of the snapshot.
amyren
Posts: 361
Joined: Thu May 02, 2019 11:53 am

Re: How to SaveSnapshot with coordinates

Post by amyren »

Thank you, CropBrush did the job :)
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: How to SaveSnapshot with coordinates

Post by airsoftsoftwair »

amyren wrote: Tue Oct 24, 2023 12:01 pm GrabDesktop does support coordinates, but that would only be usable if using a fullscreen display.
Why? Can't you pass the window coordinates and offset them by the desired display coordinates to get the desired rectangle?
amyren
Posts: 361
Joined: Thu May 02, 2019 11:53 am

Re: How to SaveSnapshot with coordinates

Post by amyren »

airsoftsoftwair wrote: Sun Oct 29, 2023 5:05 pm
amyren wrote: Tue Oct 24, 2023 12:01 pm GrabDesktop does support coordinates, but that would only be usable if using a fullscreen display.
Why? Can't you pass the window coordinates and offset them by the desired display coordinates to get the desired rectangle?
Ah, yes. I did'nt think of that. (havent used GetAttribute so much)
But even if I did, I had this issue with GrabDesktop that gave me that out of memory error on android.
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: How to SaveSnapshot with coordinates

Post by airsoftsoftwair »

amyren wrote: Sun Oct 29, 2023 8:38 pm But even if I did, I had this issue with GrabDesktop that gave me that out of memory error on android.
Yes, GrabDesktop() is currently unsupported on Android. It probably requires lots of permissions because of security considerations which is why I deliberately left out support for it because I didn't want Hollywood to be marked as something that records the screen.
Post Reply