Recent

Author Topic: Clipping region randomly gets assigned to a TPaintBox.  (Read 1147 times)

jamie

  • Hero Member
  • *****
  • Posts: 6130
Clipping region randomly gets assigned to a TPaintBox.
« on: November 22, 2018, 04:13:35 am »
I have Tpaintbox on a form and I size the paintbox  to maintain a 4:3 aspect ratio.

The box hugs the left,right and bottom of form...

 This all works fine however, randomly at times I believe if have another form partially covering it but only
on certain areas and then move that form away, the paint will then not paint that area or some area on next paint
cycles.

 This app updates the paintbox in multimedia input blocks so this is being done on its own...

 When it starts doing this, If I  drag any part of the form with the mouse, it will correct itself and the complete
image is painted..

 To fix this, at the start of each OnPaint handler event, I do this..

 PaintBox1.Canvas.Clipping := False;

 And it never happens after that.

Like I said, this is random and how to reproduce but the above fixes it..

 How is it the Paintbox is getting the Clipping property set to true?
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018