save_screenshot(3)
πΎ save_screenshot(3) πΎ
okay bestie, welcome to the Arcan Lua API corner of the group chat π this page is literally all about save_screenshot, and we are keeping every default, note, format name, and code line exactly where it belongs. no cap.
π NAME π
save_screenshotβ Store a copy of the current display to a file.
β¨ SYNOPSIS β¨
nil
save_screenshot( dstres, fmt, srcid, local )
π DESCRIPTION π
okay so save_screenshot creates a file of the latest drawn output on the primary display, or of the contents of a specific VID of specified in srcid. yes, that phrasing is staying, because we do not mess with the original technical bits π
local is the local-storage hint: it defaults to false, and setting it 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 (implementation defined) and the local copy, because they are not always in synch. the way that actually matters π«Ά
The format setting (fmt) is by default FORMAT_PNG, but it can also be FORMAT_PNG_FLIP, FORMAT_RAW 8, FORMAT_RAW 24, or FORMAT_RAW 32 β though the RAW formats are primarily for advanced use and debugging purposes. iconic for debugging, bestie, but not the everyday main character format π
πΈ NOTES πΈ
- For specific contexts, primarly
calctargets, the contents of the non-local storage is not accessible on all graphic subsystems for allsrcidsas thecalctargetmay occupy or bind the same slot. Either do the call outside such a scope or force local readback. literally read that twice if you have to π
π¦ EXAMPLE π¦
here is the example, verbatim, no cap:
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
xoxo, resource π October 2026 π save_screenshot(3) signing off π«Ά
π¦ where this page comes from
- nixos 26.05: arcan 0.7.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms