Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
save_screenshot(3)		 Arcan Lua API		    save_screenshot(3)

NAME
       save_screenshot - Store a copy of the current display to	a file.

SYNOPSIS
       nil
       save_screenshot(	dstres,	fmt, srcid, local )

DESCRIPTION
       This  function creates a	file of	the latest drawn output	on the primary
       display or of the contents of a specific	VID  of	specified in  srcid  .
       Local  (default,	 false)	 set  to true or non-zero hints	that the local
       storage should be used. This is important when there is	a  discrepancy
       between	what is	stored as the objects video backing store (implementa-
       tion defined) and the local copy	as they	are not	always in  synch.  The
       format  setting	is  by	default	 FORMAT_PNG    but  can	 also  be FOR-
       MAT_PNG_FLIP , FORMAT_RAW 8, FORMAT_RAW 24 or FORMAT_RAW	32 though  the
       RAW  formats are	primarily for advanced use and debugging purposes.

NOTES
       1      For specific contexts, primarly calctargets, the contents	of the
	      non-local	 storage  is  not accessible on	all graphic subsystems
	      for all srcids  as the calctarget	may occupy or  bind  the  same
	      slot.   Either  do  the call outside such	a scope	or force local
	      readback.

EXAMPLE
       function	save_screenshot0()
	     show_image(fill_surface(64, 64, 255, 0, 0));
	     local a = fill_surface(64,	64, 0, 255, 0);
	     move_image(a, VRESW - 64, 0);
	     local b = fill_surface(64,	64, 0, 0, 255);
	     move_image(b, 0, VRESH - 64);
	     local c = fill_surface(64,	64, 0, 255, 255);
	     move_image(c, VRESW - 64, VRESH - 64);
	     show_image({a, b, c});
       end

resource			  April	2025		    save_screenshot(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=save_screenshot&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help