If you have ever tried to create the icons, spotlights, settings and launchers for Delphi Android and iOS applications, you have quickly realized that the process is fairly ridiculous. There are 2 different platforms (iOS and Android), 3 different device types (iPhone, iPad, Android), and 7 different ratios (1:1, 1.33:1, etc) of icon/launcher graphic sizes all combining to require a whopping total of 28 different png files to be created (See Figure 1). Talk about taking the Rapid out of Rapid Application Development! 🙂
After doing this once, I realized that I never want to do that again. For my own sanity and yours, I have created a small little utility for quickly creating these 30 different png files and for helping fill in the Application Options page.
The utility works by allowing you to specify base image(s) for each graphic ratio, optionally defining what portion of the image to extract for each ratio, and then generating the png files. You have the option of creating iPhone, iPad, and/or Android files. In addition, the utility will even make the .optset files which Delphi uses to fill in the blanks (Click Apply… for each configuration and select the .optset file).
To use the Mobile Gfx Setup tool:
First, set up your images on the Graphics Tab
- For each image ratio, enter or browse to an image file
- Select the part of the image to be used for the format (shown in red)
- Move the image selection around by Ctrl Dragging the red rectangle
Next, set up the output options from the Setup tab
- Enter a base filename for the generated images. The tool will append the Width and Height of an image to this filename (e.g., ‘c:\junk.png’ becomes ‘c:\junk114x114.png’
- Select which devices you want to generate images for
- Finally, check the ‘Generate .optset file(s)’ checkbox if you want the .optset file generated which you can then later import into Delphi
Finally, generate your images from the Generate tab
- When you go to the Generate tab, the tool will verify you have entered everything correctly
- If validation has passed, click the Generate button to generate the images and, optionally, the .optset files (which will be called basename.android.optset and basename.ios.optset)
If you generated the .optset file, do the following steps:
- Load your Delphi project
- Select Project->Options to show the project options (See Figure 1)
- Click Application on the left to show application options
- Change the Target configuration
- Click the Apply… button
- Browse to the .optset file
- Modify the configuration and click OK!
I hope this is as useful to you as it is to me. Source and compiled executable: MobileGFXSetup. Requests/comments/bug fixes can be sent to me at tgrubb AT RiverSoftAVG DOT com.