I want to create a graphical component in Delphi that is editable to some extent inside the designtime editor.
I would like to know
- What component I should inherit from (for example TWinControl or whatever)
- How to handle component messages (CM_xxx) to be able to move around my component in the editor
- If it's possible to use native windows components in the designtime editor, but then switch to other component in runtime.
The reason I want to be able (if even necessary) to switch to other type of component in runtime is because the component I intend to use is TBitmap32 from the Graphics32 library which is many times faster than standard windows graphics, but TBitmap32 is not inherited from TWinControl to begin with.
Maybe if possible, I could maybe do something like using standard VCL in designtime and then just take its properties and apply them to TBitmap32.
Example: In designtime I use a TImage which I can move around, and when I run the application it takes the X and Y values, and the bitmap from TImage and apply them to the TBitmap32 component and draw the TBitmap32 component to wherever it needs to be drawn.
Code could look something like this: TMyBMP= class(TImage) private fResultBMP: TBitmap32; .....
I hope you understand, thank you!
X message
X denotes destination, not an origin. – OnTheFly