program WIN32GUI 'Sample';
//include file i/o macro inc file.
#include 'fileio.zir';
//create our file handle variable and create an empty file
DWord hFile = filecreate('.\\test.jpg');
//notice the loadfs which embeds the image at compile time
//write the embedded image at runtime, length is in bytes
DWord bytes = filewrite(hFile, loadfs('.\\leia.jpg'), 186347);
//close the file handle
fileclose(hFile);
//exit the application
ExitProcess(0);