by IDEAL Software Support » Thu Sep 25, 2014 6:39 pm
Please see in the help file titled "Programmer's Manual", chapter "Programming Techniques", subchapter "Pictures", section "Image Cache". I would like to point out the paragraph, where it is written: "Therefore you may not delete or overwrite image files, which are currently used in any open document of your application."
Indeed, the paragraph talks about image files on disk, but not about image files stored in template files. You are the first one, who deletes a template file after it has been dumped (for whatever reasons). But the same applies to VPE document files (VPE's native document file format): If you are reading a VPE document file into a new document (you can read many document files one after the other into the current document to assemble a new document), and such VPE document files contain embedded images, you may not delete the files. This is explained in the manual in the section "Pictures and VPE Document Files", but not for templates.
Here is some additional background information:
Bitmaps can be of large size, consuming a lot of memory. If you create for example a warehouse catalog with thousands of images, it is impossible to hold all images in memory. Therefore VPE has a sophisticated multi-level associative image cache, which consists of more than 15.000 lines of source code.
In the top-level, VPE holds information about an image, i.e. its type (PNG, JPG, TIF, BMP, EMF, WMF, ...), its dimensions (in pixels), resolution in DPI, etc. Now, when you are building a document, VPE retrieves this information from the image header into the top-level cache, without reading the whole image (where possible, most image types do allow this). When you are inserting such an image later many times into a document, VPE retrieves the metric dimensions of the image from its cache - without accessing the file on disk, and without accessing the bitmap bits itself.
Later, after assembling a document, when an image needs to be output to a device (screen, printer, PDF, etc.), the bitmap bits are loaded from disk into a second-level cache (in fact there is also a third level). In your case, when you dump the template into the VPE document, the image header is retrieved from the template file, without reading the whole bitmap data. This is done when you display the preview. But since you deleted the template, the image is also gone.