Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I add jpg files to a Delphi project for BitMap.CreateFromFile?
    primarykey
    data
    text
    <p>I am using Dephi RAD Studio XE5 and creating a Firemonkey project that needs to run on android, ios, and win32.</p> <p>I am trying to load a bitmap using BitMap.CreateFromFile(). I've added an 'images' folder to the project and stored the images in that folder. I've also added the images to the project so that they appear in the Project Manager view.</p> <p>The problem is that when I try to use</p> <pre><code>TBitmap.CreateFromFile('images/myimage.jpg') </code></pre> <p>my app on win32 gives me the following error message:</p> <p>Cannot open file "C:...\Win32\Debug\images\myimage.jpg"</p> <p>Which suggests that the build process isn't copying the image files into the Debug folder.</p> <p>How do I convince the build process to copy the images folder into the Debug folder?</p> <p>edit:</p> <p>Yes, I understand that computers aren't mind readers. :) Notwithstanding, when eclipse (for example) encounters a file in its src directory that it doesn't recognize as source code (like a .jpg or .xml) it will happily copy the file into the corresponding location in the bin directory. The underlying assumption is that the dev knows what they are doing. That's all I am looking for here.</p> <p>I could use resources, but I don't like the idea of compiling images into my executable. Eventually, I'll want to change the images, perhaps having the app download additional images from a URL and caching them in the images directory. Who knows? Compiling images into an executable feels like closing the options box for future expansion.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload