Futurebasic/Language/Reference/def drawimagefile

From Wikibooks, open books for an open world
Jump to navigation Jump to search

DEF DRAWIMAGEFILE Statement[edit | edit source]

DEF DRAWIMAGEFILE[edit | edit source]

Statement[edit | edit source]

✔ Appearance ✔ Standard ✔ Console

Syntax[edit | edit source]

DEF DRAWIMAGEFILE ( fName$ , vRef% )

Revised[edit | edit source]

May 2001 (Release 5)

Description[edit | edit source]

You may use this statement to display a picture directly from disk. The picture can actually be too large to load into memory. You may determine the size of the picture in advance using DEF GETIMAGEFILERECT. The following example shows how to open a file and display it in a window.

Note[edit | edit source]

In order to use this routine, you must include the file named "Subs Image Files.Incl" as shown in the example below.

INCLUDE "Subs Image Files.Incl"

DIM fName$
DIM @vRef%
DIM r as rect
gFBUseNavServices = _ztrue
fName$ = FILES$(_fOpenPreview,,"Select a file to open", vRef%)

LONG IF fName$[0]
  DEF GETIMAGEFILERECT(fName$,vRef%,r)
  OFFSETRECT(r,-r.left,-r.top)
  WINDOW 1,fName$,@r,_docNoGrow
  DEF DRAWIMAGEFILE(fName$,vRef%)
END IF

PRINT @(1,1)"Click to exit"

DO
UNTIL FN BUTTON

See Also[edit | edit source]

DEF GETIMAGEFILERECT