Back to Contents        Previous        Next








10. Drawfiles

PROCwimp_initdfiles
Initialises various blocks of memory ready to use with drawfiles.

FNwimp_measurefile(filepath$,warning%)
Returns the size in bytes needed to store a file in memory prior to using FNwimp_loadfile(), FNwimp_loaddfile(), FNwimp_loadsprites() or FNwimp_loadjpegfile().
Returns -1 if filepath$ not found.
Always use this as opposed to any other form of measurement.
filepath$ = full pathname of sprite­file.
warning% - if not 0, a non-fatal warning will be given if filepath$ cannot be found.
(This function is also listed in in other sections)


FNwimp_loaddfile(filepath$,address%,warning%)
Loads a drawfile into a block of memory at address%.
The memory block must have already been created after using FNwimp_measurefile().
Returns the address (handle) at which to load the next file (if any) into the same memory block. (If filepath$ cannot be found the return will be the value of address% i.e. memory not used.)
filepath$ = full pathname of drawfile.
If warning% is not 0 then a non-fatal error will be given if filepath$ cannot be found.

FNwimp_getdfilesize(dfile%,side%)
Returns the width/height (in OS units) of drawfile graphic which has been loaded into memory using FNwimp_loaddfile().
dfile%= drawfile handle
If side% = 0 returns width.
If side% = 1 returns height.
N.B. the returned dimensions are those of the overall ‘bounding box’ surrounding all the drawfile objects i.e. as if all objects were ‘grouped’.


PROCwimp_savedfile(savepath$,dfile%)
Saves a drawfile stored in memory into a file.
dfile% = handle of drawfile to save (which must have been loaded into memory using FNwimp_loaddfile).
savepath$ = full pathname to save to.



PROCwimp_render(dfile%,bx%,by%,minx%,miny%,maxx%,maxy%,scale-x,scaley,origin%)
Renders (draws) a drawfile at the specified screen coordinates, using a clipping rectangle. Requires RISCOS Version 3.60 or higher.
All coordinates are in OS units.
dfile% = handle of drawfile to render (from using
FNwimp_loaddfile)
bx%,by% = screen coordinates of where to put bottom left corner of
drawfile.
minx%,miny% = screen coordinates of bottom left corner of clipping rectangle.
maxx%,maxy% = screen coordinates of top right corner of clipping rectangle.
(Clipping rectangle is the same as that passed to PROCuser_redraw.)
scalex,scaley = respectively, required scaling factors in x and y directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size). Note that values less than 0 can be used, which will render the drawfile back-to-front and/or upside-down (but this will not work for JPEG objects in a drawfile).
If origin% = 0 drawfile will be rendered with bottom left corner of drawfile page at bx%/by%.
If origin% = 1 drawfile will be rendered with bottom left corner of drawfile objects overall bounding box at bx%/by%. (See Section 2.19)


PROCwimp_renderwindow(window%,dfile%,bx%,by%,minx%,miny%,ma-xx%,maxy%,scalex,scaley,origin%)
Renders (draws) a drawfile in a window at the specified work area coordinates, using a clipping rectangle. Requires RISCOS Version 3.60 or higher. The window must have its auto-redraw flag unset. All coordinates are in OS units.
window% = handle of window.
dfile% = handle of drawfile to render (from using
FNwimp_loaddfile)
bx%,by% = work area coordinates of where to put bottom left corner of drawfile.
minx%,miny% = screen coordinates of bottom left corner of clipping rectangle.
maxx%,maxy% = screen coordinates of top right corner of clipping rectangle.
(Clipping rectangle is the same as that passed to PROCuser_redraw.)
scalex,scaley = respectively, required scaling factors in x and y directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size). Note that values less than 0 can be used, which will render the drawfile back-to-front and/or upside-down (but this will not work for JPEG objects in a drawfile).
If origin% = 0 drawfile will be rendered with bottom left corner of drawfile page at bx%/by%.
If origin% = 1 drawfile will be rendered with bottom left corner of drawfile objects overall bounding box at bx%/by%. (See Section 2.19)




Top of page        Back to Contents        Previous        Next