Thanks very much for the code on the line drawing. Just a little snag on the stretch draw bit on my end. I can't seem to be able to draw the IEBitmap stream to the left or right of the line. I would appreciate if you could assist in giving a code snippet on this?
Thanks again and sorry for the inconvenience.
Andy
xequte
Posted - Dec 18 2014 : 03:44:04 Hi Andy
On mouse move save the mouse position as a property, then invalidate the paint box. In your paint event use something such as:
With aPaintBox do
begin
Canvas.Pen.Style := psDot;
Canvas.Pen.Color := clBlack;
Canvas.MoveTo( fMousePosX, 0 );
Canvas.LineTo( fMousePosX, Height );
end;
Thank you for the code steps. I am not too successful in drawing the dividing line on the TPaintBox. I would appreciate any code snippets to do this with the TPaintBox. I imagine it is done in the OnPaint event?
Thanks again.
Andy
xequte
Posted - Dec 14 2014 : 12:53:00 Hi
There is no built-in component for this, but you could do it fairly easily: - Load an image - Set its IO.Params and then save it to Stream A - Load IEBitmap A from Stream A - Sets it alternative IO.Params and then save it to Stream B - Load IEBitmap B from Stream B - Add a TPaintbox to a form. Store a fLastMouseX field. On mouse move, if X has changed from fLastMouseX then stretch draw IEBitmap A and IEBitmap B onto the respective sides of the TPaintbox, draw a dividing line and output your text