FMX.Graphics.TCanvas.IntersectClipRect

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure IntersectClipRect(const ARect: TRectF); virtual;

C++

virtual void __fastcall IntersectClipRect(const System::Types::TRectF &ARect);

Properties

Type Visibility Source Unit Parent
procedure
function
public
FMX.Graphics.pas
FMX.Graphics.hpp
FMX.Graphics TCanvas

Description

Defines the drawing area by intersecting the current clipping area of the TCanvas and a rectangle.

The ARect parameter specifies the rectangle used in the intersection.

If ARect is empty, IntersectClipRect does nothing. It does not raise any errors.

Note: The clipping rectangle only operates if the canvas state is first saved using SaveState. For example:

var
  MyCanvas: TCanvas;
  Save: TCanvasSaveState;
  MyRect : TRectF;
begin
  try  
    Save := MyCanvas.SaveState;
  
    // Create the clipping rectangle
    MyRect.Create (20, 20, 100, 100);   
    MyCanvas.IntersectClipRect (MyRect);
    
    // Do your drawing here

  finally   
    MyCanvas.RestoreState(Save);
  end;
end;

See Also