[Lazarus] Custom GraphicsControl - need Canvas to set Height outside OnPaint

zeljko zeljko at holobit.net
Mon Apr 7 11:11:28 CEST 2014


On 04/07/2014 11:01 AM, Petr Kristan wrote:
> Hi.
>
> I'am creating an graphics control and I need Canvas to set control
> Height. But I can draw (access to Canvas) only in OnPaint event.
>
> How to solve this problem?

You need to set height of control by calculating text height out of 
paint event ?  I'm using TBitmap for such measurements.
Create bitmap, assign control font to bmp canvas, measure.

z.





More information about the Lazarus mailing list