[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3.5.3 Load Picture References (%B)

The Load Picture References command scans the input file for occurrences of the Display Picture (#B) command. If it finds a Display Picture command that identifies its target by name (instead of by number), it loads the picture referenced. It will not load the same picture twice, even if it is displayed more than once.

This pre-loading mechanism is used to ensure that at the time of the display, the system already has all the image data it needs and will not have to pause to access disk. In experiments that must show pictures rapidly in succession, this is a critical feature.

The Load Picture References command can optionally take arguments which change the current picture type and current picture path before scanning/loading. If a filename is not absolute (that is, it doesn't start with an MS-DOS drive letter, like `C:\MYDIR\MYPIC.PCX') then the Cogsys system constant DEFAULT_PIC_PATH (by default, `') is prepended to the file before it is loaded.

It continues scanning input until it gets to another Load Picture References command, or reaches the end of file. This command can not be run within a macro.

Name:
Load Picture References
Class:
Pictures
Code:
%B
Syntax:
%B [ [pictype[, picpath]
pictype is 1 or 2, representing picture type
picpath is a pathname
System:
If present, changes the current picture type pictype and the picture path to `picpath'. Then, it scans the input list up to the next %B or EOF for #B calls which refer pictures by name, and loads the referred pictures.
Requires:
This command can not be run within a macro.
History:
As noted at the beginning of this section, picture loading before Cogsys 3 was very inefficient and awkward.

The history notes for Load Picture List detail one way translate a list which uses the %F/!...! mechanism.

Alternatively, Load Picture References can be used to avoid the need for a list entirely. Start the block of commands which display pictures with a %B command. Then, replace calls to #B with ones which directly name the picture you want each to display.

Test Files:
`LPIR_T01.IN'
tests basic operation

Examples:

input
%B[2,C:\PICTURES]#B[DAFFY,20]
cogsys
The %B command explicitly sets the picture type to 2 and sets the default picture path to `C:\PICTURES'. Cogsys then scans the input for occurences of #B like the one immediately following, and loads the picture it references (here, `C:\PICTURES\DAFFY.PCX'. Then, the #B command displays the picture for 20 milliseconds.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Usman Muzaffar on June, 28 2000 using texi2html