Steps to crating a new (graphics) component from TImage. Or, in other words, how to create a new component from an existing one.
Difficulty Level: easy Time Required: 5 minutes
- Start Delphi and select File | New ...
- Double-click the Component icon in the Object Repository.
- The "New Component" dialog box is displayed.
- Use the drop-down list to select a base class (Ancestor type).
- Select TImage.
- Type the name of your new component's class in the Class Name field. Type TPictureClip (or some other name)
- Select the Component palette location in which you want to place this derived component. Select "Samples".
- Click on OK.
- The Code Editor appears and displays a new source code unit.
- Save the unit as PictureClip.pas.
- You are now ready to code you own TPictureClip component.
When you create a new component, you should choose a base class that most closely matches the type of component you want to create (step 4).
The Unit file name field is used to specify the name of the file that will contain the component's source.
- How To Install Custom Component in Delphi (into existing package).
- TPictureClip - Use TPictureClip custom component to extract portions of a matrix of pictures and assign the "cell picture" to another picture control.
- Custom Component Development - Everything about creating custom components in Delphi. The ultimate source.
- More Delphi Programming HOW TOs