This wiki is out of date, use the continuation of this wiki instead

Get screen

From FenixWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 11:25, 14 June 2007 (edit)
Sandman (Talk | contribs)

← Previous diff
Current revision (15:04, 25 February 2008) (edit) (undo)
85.144.194.29 (Talk)
(Category changed to Screen)
 
(3 intermediate revisions not shown.)
Line 1: Line 1:
[[Category:functions]] [[Category:functions]]
-[[Category:maps]]+[[Category:screen]]
==Definition== ==Definition==
Line 7: Line 7:
Creates a new map containing a snapshot of the screen. Creates a new map containing a snapshot of the screen.
-The map will contain everything, including background, [[process]]es, [[draw]]ings and [[text]]. The newly created [[graphic]] will be located in the [[File]] with [[FileID]] 0, the system FPG.+The map will contain everything, including background, [[process]]es, [[draw]]ings and [[text]]. The newly created [[graphic]] will be located in the [[File]] with [[FileID]] 0, the system FPG. After the use of this graphic, it should be freed using [[unload_map]]().
== Returns == == Returns ==
Line 27: Line 27:
my_map = get_screen(); my_map = get_screen();
save_png(0,my_map,"snapshot.PNG"); save_png(0,my_map,"snapshot.PNG");
 + unload_map(0,my_map);
while(key(_F5)) frame; end while(key(_F5)) frame; end
end end
Line 33: Line 34:
End End
</pre> </pre>
-Used in example: [[key]](), [[save_png]]()+Used in example: [[key]](), [[save_png]](), [[unload_map]]()
 + 
 +{{Funcbox
 + | category = Screen
 +}}

Current revision


[edit] Definition

INT get_screen ( )

Creates a new map containing a snapshot of the screen.

The map will contain everything, including background, processes, drawings and text. The newly created graphic will be located in the File with FileID 0, the system FPG. After the use of this graphic, it should be freed using unload_map().

[edit] Returns

INT : GraphID

0 - Some error.
>0 - The GraphID of the graphic created.

[edit] Example

Program snapshot;
Global
    int my_map;
Begin
    Repeat
        if(key(_F5))
            my_map = get_screen();
            save_png(0,my_map,"snapshot.PNG");
            unload_map(0,my_map);
            while(key(_F5)) frame; end
        end
        frame;
    Until(key(_esc))
End

Used in example: key(), save_png(), unload_map()


Screen Functions
Clear_screen() • Get_screen() • Put() • Put_screen() • Xput() •
Personal tools