Delphi image editoris a tool that can be used to create and edit a map (.bmp), icon (. ICO) and cursor (. you can also use it to create a resource project, including multiple bitmaps, icons, and cursors to a single resource file (. res), and then add the resource file to the Delphi project for use as needed. For example, the image editor is being edited.
Note
All the windows images are bits, regardless of whether they are real windows Map Files (.bmp) or icons or cursors. In our explanation, all images are called bitmaps. Image editor can only process Windows bitmap files. It does not support other file formats, such as PCX, Tiff, JPEG, and GIF.
You can select the image editor menu item from the Start menu to start the image editor, or open the menu item tools | image editor in the main menu of Delphi (for example ). Image editor is a separate program that does not have to be run in Delphi IDE.
Introduction to each part of image editor
List all tool names in the toolbox. Familiarize yourself with them.
The Marquee selection tool works the same way as the lasso plug-in tool. The former is used to select the rectangular area, and the latter is used to select any shape.
When an area is selected, you can cut or copy images in the area. Use the marquee and lasso tools to select an area, move the mouse cursor to this area (the mouse cursor turns into a hand-shaped cursor as shown in figure), and drag the mouse. The image in the area moves as you drag the mouse.
When you cut or move an area, the original area is filled with the current background color.
Note
If a region is selected, the image to be pasted scales with the size of the selected region. For example:
When using the eraser rubber tool, the usage of the left and right keys of the mouse is the opposite of that of other tools. When eraser is used, the left mouse button draws with the background color, and the right mouse button draws the foreground color.
The text tool allows you to write text on images. When writing text, you can use the current text settings. You can click [text] on the main menu to set the font attributes and text alignment, for example:
Tip
When drawing a rectangle, you can press the Shift key to convert the rectangle into a square. Similarly, you can use an elliptical tool or an elliptical tool with padding to draw a circle. You only need to hold down the Shift key while dragging the mouse. You can also draw a straight line (horizontal line, vertical line, or 45 ° line) using the Shift key and line drawing tool ).
To change the foreground color, use the mouseLeft clickClick the color on the color palette.
To change the background color, use the mouseRight-clickClick the color on the color palette.
You can also use the eye dropper straw tool in the toolbox to obtain the color of the image, move the tool to the selected color area on the image, to set the foreground color, click the left button; To set the background color, right-click.
When drawing with a drawing tool, you can use both foreground and background colors. Use the left mouse button when drawing with the foreground color; right mouse when drawing with the background color.
Note
The text tool can only use foreground colors. Text cannot be written using the background color. If you want to use the background color, you must change the foreground color to the background color before writing the text.
Transparent and reverse colors
You can select a transparent color when drawing icons and labels. When transparent colors are used, the background under the icon is displayed in transparent colors.
Whether or not to use transparent colors depends on personal requirements and the specific icons created. When creating a cursor, the transparent color is usually used as the background color of the cursor.
Selecting a reverse color will reverse the background color under the chart. Reverse colors are not commonly used, but can also be used when needed.
When editing icons and labels, both transparent and reverse colors are displayed next to the color palette. They are colored squares with a curve passing through them.
Note
Lack of time, the background of the new icon and the cursor resource is transparent. For example:
Zoom
You can zoom in the bitmap in the image editor. You can use the Zoom tool to zoom in the bitmap or View menu. Use the Zoom tool to zoom in a certain part of the image. Select the Zoom tool from the toolbox and drag it to enclose the rectangular boundary of the part to be enlarged. When you drag the mouse, the image of the part to be enlarged will be enlarged with the enlargement of the rectangular boundary. In this way, every detail in the bitmap can be better modified.
You can use the options in the View menu to scale the bitmap, for example:
- Zoom in or [Ctrl + I], the image will be enlarged according to the predefined proportion;
- Zoom out or [Ctrl + u], the image can be scaled back;
- Actual size or Ctrl + Q to display the actual size.
When you create a cursor or icon, the image editor window is split into two halves. For example:
Although both sides of the image can be enlarged, usually the enlarged image is placed in the left window, the actual size of the image is placed in the right window.
Line width palette (stroke palette)
The line width palette is located at the bottom of the Toolbox. Based on the selected tool, the width of the line or the stroke shape of the brush is displayed on the line width palette. Click the Desired width or brush shape, and use the new line width or brush shape for subsequent painting operations. For example:
Bitmap files
You can create a bitmap from scratch or call an existing bitmap to modify it. To open an existing bitmap file, select file | open from the main menu to open the bitmap file to be modified.
To create a new bitmap, select file | new from the main menu, and select bitmap file from the pop-up menu ],
The bitmap Properties dialog box is displayed, for example:
In the bitmap Properties dialog box, you can set the bitmap size (in pixels) and the number of colors (2, 16, and 256 ).
Note
Image editor does not support bitmaps with more than 256 colors.
Select the desired size and color number, and click OK. A blank bitmap is displayed in the editor window. Then, you can start drawing. For example:
After editing the bitmap, select file | save or file | Save As to save the bitmap file to the disk.
When creating or editing a bitmap file, there is one menu item on the main menu of image editor called bitmap, but there is only one menu item [image properties ]. Select this menu item to open a bitmap Properties dialog box (just like creating a new bitmap file), such:
You can change the size and color number of the bitmap in the bitmap Properties dialog box.
Note
The bitmap Properties dialog box displayed when creating a new bitmap is different from the bitmap Properties dialog box displayed when editing the bitmap. When editing a bitmap, the bitmap Properties dialog box contains a stretch check box, which is used to change the size of the bitmap. If the stretch check box is not selected, when the bitmap size is changed, the bitmap does not scale with the size change. If the stretch check box is selected, the bitmap expands or shrinks with the size change. Bitmap expansion and contraction are not very accurate, so the effect is sometimes unsatisfactory.
In short, using image editor to create or edit bitmap files is that simple. Although the performance of the image editor can meet the needs when creating or editing a simple bitmap, It is not great to use it to create or edit a complex image.
Icon Application
Creating an icon is also an artistic task, but it is not as artistic as creating a full-color bitmap. Most of the time, users can create their own icons, but it still requires a lot of skill to create beautiful icons.
Note
Load any bitmap file that can be found, zoom in the bitmap file, and view it carefully to obtain the experience of creating beautiful icons. Creating 3D icons requires many practices.
In 32-bit windows, the actual size of an icon is one or two small icons. The size of a large image is 32x32 pixels, which can be placed in the about dialog box. The application Icons can also use large icons. This icon is also used when the file list window in Windows Resource Manager is set to a big image. For example:
The size of a small icon is 16x16 pixels. Small icons are used in the application title bar, on the Windows taskbar, and in the file open dialog box. When the file list window is set as a small icon, Windows Resource Manager also uses small icons. Large icons and small icons are stored in the same icon file (. ICO ). For example:
Note
You do not need to provide both large and small icons. If only a large icon is provided, Windows will narrow down the large icon to a small icon when a small icon is required. However, the small icon is usually not as effective as expected. In this case, you can create a small icon to control the appearance of your application, instead of relying on Windows.
1) create a new icon Resource
To create a new icon resource, select file | new | icon file (. ico) from the main menu. The icon properties dialog box is displayed, for example:
This dialog box allows you to select the Icon size and number of colors.
Note
Even if you want to create both large and small icons, You must select one of them at the beginning. For example, you can create a large icon when creating a new map. After creating a large icon, you can create a small icon.
When editing an icon in the image editor, there is a menu item named [icon] on the menu bar of the image editor, for example:
[New] The menu item is used to create a new icon. For example, if a large icon has been created, you can select [icon | new] from the main menu to create a small icon.
Tip
The icon editor window contains a new button, which can also be used to create a new icon. Using the new button to create a new icon is faster than using the main menu.
However, when you select new to create the second icon, the icon properties dialog box is displayed. If the first icon is a large one, the small icon is selected by default. You only need to click OK.
Tip
When the size icon appears at the same time, you can use the combination selection box at the top of the icon editor window to switch from one icon to another. For example:
2) icon editing options
The delete menu in the icon menu enables you to delete large or small icons from the icon resource, but you cannot delete the last icon in the icon resource.
The "test" menu item in the "icon" menu shows the icon tester dialog box, where the icon's actual touch is displayed. For example:
Icon tester can be used to change the background color of an icon. Therefore, you can view the effects of different background colors on the icon. If you are editing a large icon, the big icon is displayed in the icon tester. If you are editing a small icon, the small icon appears in the icon tester dialog box.
Cursor Application
There is no big difference between creating and editing the cursor and creating and editing the icon. The cursor has only two colors: White and Black (image editor does not support multi-color cursor and animated cursor ).
When you edit a cursor, the cursor menu appears on the image editor menu, for example:
[Set hot spot ...] The menu item is used to set the hot spot of the cursor ). Hotspot refers to a specialized pixel on the cursor. When a cursor is used, Windows uses this specialized pixel to report the coordinates of the mouse. For example, the "+" font cursor's hotspot is its center point, and the arrow cursor's hotspot is set at the arrow vertex. To set a cursor hotspot, select [cursor | set hot spot…] from the main menu ...], The Set cursor hot spot dialog box is displayed. In this dialog box, enter the X and Y coordinates of the hotspot.
Tip
You must enter the accurate X and Y coordinates of the hotspot. Before setting the hotspot, move the editing cursor to the pixel that you want to set as the hotspot. The X and Y coordinates pointed by the editing cursor are displayed on the status bar of the image editor; record the X and Y coordinates.
[Cursor | test ...] The menu item is used to preview the new cursor. Click this menu item to display the cursor tester dialog box, for example:
Press and hold the left mouse button or right-click to draw on cursor tester. If no hotspot is set, the hotspot of the optical subject is set in the upper left corner of the cursor by default.
Image editor shortcut menu
Each editing mode of image editor has a shortcut menu. Right-click is used for drawing, so when the mouse cursor is on the image, you cannot click the mouse button to display the shortcut menu. When the mouse cursor is in the editor window but not on the image, right-click to display the shortcut menu.
Create a resource project
Image editor allows you to create a resource project file to store all your bitmaps, icons, and cursors. Select File | new | resource file (. Res)… from the main menu )...] Create a resource project file. In this case, user I displays a project window, which is a tree window that controls the bitmap, icon, and cursor in the project. For example:
When you save a resource file, image editor compiles it into a binary resource file. Then you can add the binary resource file to your Delphi project.
1) create a new resource
To create a new resource for a resource project, select new from the shortcut menu in the project window ],
Or select the resource | new menu item from the main menu,
Then select create bitmap, icon, or cursor as before when creating a single resource file. A resource editor window is displayed. You can use the drawing tool to create the required resources.
2) EDIT Resources
After creating a resource, you may need to modify the resource. You can modify resources by editing resources. To edit a resource in the resource project, find the resource in the project window tree, and double-click its resource name. A resource editor window appears, you can edit the resource.
3) Rename the resource
Select the resource to be renamed in the tree window, and click it to rename the resource. You can also select the rename menu item from the shortcut menu to rename it. After the new name is entered, press ENTER or click another item on the tree to change the resource name to a new name.
4) delete a resource
To delete a resource from the resource file, click the resource name in the project tree to select it, and then select the delete menu item from the shortcut menu. The system will prompt you: are you sure you want to delete this resource? For example:
When the Yes button is clicked, the resource will be deleted. The deleted resource item cannot be recovered.
5) Add resources from other resource files
There is no simple way to add resources contained in a single file to the resource project. You can only open the project file first, and then open a single bitmap, icon, or cursor file that contains the resources to be added to the project. select Edit | select all from the main menu to select resources, select Edit | copy to copy the selected resource to the clipboard. Create a resource in the resource project. When the resource editor is displayed, click Edit | paste to paste the resources in the clipboard to the new resource.
Note
If the object added to the Resource Project is a bitmap, you need to check the properties of the bitmap to grasp the width, height, and color number of the bitmap. These settings are required when creating a new bitmap in the resource project.
Image editor is not an advanced image editor, but it can be used to create many image tasks. It is easy to use and the icons and cursors created are mostly superior in quality.
Here we recommend a third-party resource editor, which is very useful for resource builder.
Resource builder-a very useful full-featured resource editor in windows. You can use its built-in visual editor to visually edit resource files such as EXE, DLL, RC, and Res, and fully support Unicode. You can patch, modify, and update Resources in the executable module, such as EXE, DLL, and other files (PE-files ). You can import and browse resources in executable files to create resource-only DLL files (for software localization) and other useful and powerful functions. The software supports Unicode, Unicode resource scripts, multilingual user interfaces, user-defined control libraries, and menuex resources. You can add or delete resources at will, and the software has built-in powerful image and Icon editors.
For example: