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

FreeBSD Manual Pages

  
 
  

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

NAME
     load_image_asynch - asynchronously load an image from a resource

SYNOPSIS
     VID, fail:BADID
     load_image_asynch( resource, callback )

DESCRIPTION
     Sets up a new video object container and attempts to load and decode an im-
     age from the specified resource.

NOTES
     1	    The  new  VID   has its opacity set to 0, meaning that it will start
	    out hidden.

     2	    The operation can be forced asynchronous by either doing  an  opera-
	    tion  which  requires  a  stable state for the current context (e.g.
	    push/pop_video_context) or by explicitly calling image_pushasynch.

EXAMPLE
     function load_image_asynch0()
	   vid = load_image_asynch("test.png", function(source, tbl)
				   if (tbl.kind == "loaded") then
		 resize_image(source, tbl.width, tbl.height);
		 warning("image loaded0);
				   elseif (tbl.kind == "load_failed") then
		 warning("couldn't load:" .. tbl.resource .. "0);
	   end);
	   show_image(vid);
     end

MISUSE
     function load_image_asynch0()
	   vid = load_image_asynch("test.png", load_image_asynch);
     end

MISUSE
     function load_image_asynch1()
	   vid = load_image_asynch("test.png", -1);
     end

SEE ALSO:
     image_pushasynchload_image(3)

image				   August 2026		    load_image_asynch(3)

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

home | help