How to use your own icons for the Delph component

Source: Internet
Author: User

How can I use my own icons for components developed with Delphi? What are the mysteries in it?
To use your own icons for a widget, perform the following steps:
(1) Know the component information: the component name I want to register is tnwtreport, which is in the nwtreport. Pas unit.
(2) create a DCR file with the same name as the unit file of your component. Here it is nwtreport. DCR: Add a 24*24 bitmap file to this file. The file name must be the same as your component name and all must be in uppercase.
Tnwtreport.
(3) Place the nwtreport. DCR in the same directory of the component unit nwtreport. Pas.
(4) Add the nwtreport. Pas component unit again in your component package nwtreport7.dpk. In this case, the nwtreport7.dpk component package will automatically add a DCR file nwtreport. DCR.
(5) re-compile and install it.

Note: You can use the image editor software provided by Delphi to complete the above work.
DCR is actually a resource file that can contain several 16-color bitmaps of 24x24 size. These bitmaps are only used during design and are the icons that represent the control displayed in the component Platte. When the IDE loads a package XXX. BPL,

It will find a file named XXX in the directory where the package is located. DCR file. If it is found, the file will be loaded. For the component named YYY in the package, the resource item (Bitmap) named YYY will be searched in the resource. If it is found, the resource will be called.

The source item is drawn in the component Platte to represent the component yyy. If no bitmap is found, the default bitmap is used to draw components in the package. These bitmaps are not used during runtime, so such files are not compiled into DCU or EXE (BPL. Any

Tools that can open res files should be able to open DCR files. After opening, each item can be saved as a BMP file and can be reused.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.