Board index » delphi » How to Use tcanvas.cliprect

How to Use tcanvas.cliprect

Hi,

I am trying to use the Tcanvas.cliprect property with the printer
canvas.
However, the documentation says the cliprect cannot be assigned to.
I have tried this and it does seem to be the case.

How then can I restrict the cliprect (clipping rectangle) on the printer
canvas without
having to calculate all the boundaries. I thought this was an easy way
using the tcanvas.cliprect but cannot seem to understand how it works.

Thanks for any help on this.
Gary Sims
gs...@gasman.com

 

Re:How to Use tcanvas.cliprect


Use This

 HRG Rgn;
 Rgn:=CreateRectRgn(x1,y1,x2,y2);
SelectClipRgn(Printer.Canvas.Handle,Rgn);

This will do the job Rgn - SelectCLipRgn is API function

Bye

NirmalKannan

Quote
Gary Sims <gs...@gasman.com> wrote in message

news:384F9B5C.5700BA32@gasman.com...
Quote
> Hi,

> I am trying to use the Tcanvas.cliprect property with the printer
> canvas.
> However, the documentation says the cliprect cannot be assigned to.
> I have tried this and it does seem to be the case.

> How then can I restrict the cliprect (clipping rectangle) on the printer
> canvas without
> having to calculate all the boundaries. I thought this was an easy way
> using the tcanvas.cliprect but cannot seem to understand how it works.

> Thanks for any help on this.
> Gary Sims
> gs...@gasman.com

Other Threads