Resource

EPL Resource is for you to store and use binary data like picture, sound and any binary file, the data type of resource is Bin. To use pre-defined resource is same as using constant. Just write a “#” prefix before the resource name, such as if the name of the source is “Picture1”, you just use ”#Picture1” to indicate the resource.

Adding Resource

Add Picture/PictureList Resource

To add a new picture or picture list resource to you application, you can click “Insert” ->”Resource” ->”Picture/Picture List” menu. After add a new resource, you must specify a meaningful name for the picture or picture list resource, and double click on the “Content” element to popup a picture resource editing dialog as the picture below

EPL

You can click “Import New” button to insert a new picture, and then Click “Add/Change Resource and Close” to confirm to add or update the new resource.

To click Picture List button, you can activate Picture List editor, see picture below

EPL

To click the “Delete” button, you can delete the current editing resource, and you must click “Add/Change Resource and Close” button confirm the deleting.

To click the “Export” button, you can export the current editing resource to a binary file.

To click the “Add/Change Resource and Close”, you can confirm and save the current editing resource to application, and close the dialog.

If the new picture resource has been added that not empty, the Content element of the resource will show the resource size, and you can also double click on the content element to view or edit the resource. See picture below

EPL

Notice that, you can also import other binary file as import a picture, and the resource can’t be used as a picture resource, but actually it can be used as a bin type resource.

Add Audio Resource

To add a new audio resource to your application, you can click “Insert” ->”Resource” ->”Audio” menu. After add a new resource, you must specify a meaningful name for the audio resource, and double click on the “Content” element to popup a Audio Resource editor as the picture below

EPL

You can click “Import” button to insert a new audio, so far support “*.Wav” and “*.Mid” format, and then click “Add/Change Resource and Close” button to confirm to add or update the new resource.

To click the “Delete” button, you can delete the current editing resource, and you must click “Add/Change Resource and Close” button to confirm the deleting

To click the “Play” button, you can listen to test the current editing audio, and click Stop button to stop the playing.

To click the “Export” button, you can export the current editing resource to a binary file.

To click the “Add/Change Resource and Close”, you can confirm and save the current editing resource to application, and close the dialog.

If the new audio resource has been added that not empty, the Content element of the resource will show the resource size, and you can also double click on the Content to view or edit the resource. See picture below

EPL

Using Resource

To use an already added resource, you can write “#” mark before the resource name to use it. For example, if you want to set background picture of “_MainForm” by resource named “Picture1”. You can code like the following

 

        _MainForm.PictureMode = 2

        _MainForm.Picture = #Picture1

 

Export Resource

Actually all the resources are binary format data, just same as Bin data type. You can use the “BinToFile” function to export any resource to a binary file. For example, if you want to export resource of “Picture1” to the directory of “c:\picture1.bmp”, you can code like the following

 

         BinToFile(“c:\Picture1.bmp”, #Picture1)