Vcl.Graphics.TCustomCanvas.ClipRect

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property ClipRect: TRect read GetClipRect;

C++

__property System::Types::TRect ClipRect = {read=GetClipRect};

Properties

Type Visibility Source Unit Parent
property public
Vcl.Graphics.pas
Vcl.Graphics.hpp
Vcl.Graphics TCustomCanvas

Description

Read-only property that specifies the boundaries of the clipping rectangle.

Use ClipRect to determine where the canvas needs painting. ClipRect limits the drawing region of the canvas so that any drawing that occurs at coordinates outside the ClipRect is clipped and does not appear in the image.

When handling a form's OnPaint event, the canvas's ClipRect property is set to the rectangle that needs to be painted. Portions of the image that do not overlap the ClipRect do not need to be drawn. Thus, OnPaint routines can use the value of ClipRect to optimize painting, speeding the overall performance of the application.

Note: ClipRect can be modified using the SelectClipRgn Win32 API.

See Also

Code Examples