Recent

Author Topic: [Solved] deactivate IntersectClipRegion  (Read 272 times)

Paolo

  • Sr. Member
  • ****
  • Posts: 428
[Solved] deactivate IntersectClipRegion
« on: September 18, 2023, 07:14:48 pm »
Hello, (win 10, 64-bit, FPC/LAZ 3.2.2/2.2.6

I have a code like this, that allows writing inside a specific boundary (given by FActiveRect) and anything outside is properly clipped

Code: Pascal  [Select][+][-]
  1. var
  2.   FVideoBitMap : TBitMap;
  3.   FActiveRect : TRect;
  4. ...
  5.   FVideoBitMap.Canvas.IntersectClipRect(FVideoBitMap.Canvas.Handle, FActiveRect.Left,  FActiveRect.Top, FActiveRect.Right, ActiveRect.Bottom);
  6.   DoDrawing;
  7. ...
  8.  
however, how to restore the full access to the bitmap (ie disabling the effect of IntersectClipRect) ?
« Last Edit: September 18, 2023, 09:23:47 pm by Paolo »

ASerge

  • Hero Member
  • *****
  • Posts: 2106
Re: deactivate IntersectClipRegion
« Reply #1 on: September 18, 2023, 09:13:50 pm »
however, how to restore the full access to the bitmap (ie disabling the effect of IntersectClipRect) ?
Code: Pascal  [Select][+][-]
  1. SelectClipRgn(FVideoBitMap.Canvas.Handle, 0);
And IntersectClipRect is a standalone function, not a TCanvas method.

Paolo

  • Sr. Member
  • ****
  • Posts: 428
Re: deactivate IntersectClipRegion
« Reply #2 on: September 18, 2023, 09:23:13 pm »
Ooops Copy-paste error, you are right.

Code: Pascal  [Select][+][-]
  1. var
  2.   FVideoBitMap : TBitMap;
  3.   FActiveRect : TRect;
  4. ...
  5.   IntersectClipRect(FVideoBitMap.Canvas.Handle, FActiveRect.Left,  FActiveRect.Top, FActiveRect.Right, ActiveRect.Bottom);
  6.   DoDrawing;
  7. ...
  8.  

many thanks for the support, now my code with SelectClipRgn(FVideoBitMap.Canvas.Handle, 0) seems working as expected.

 

TinyPortal © 2005-2018