Re: Clip area of a canvas...

Adam Starkey <[email protected]> Fri, 7 Feb 2003 11:51:13 -0600
Newsgroups gmane.comp.lang.delphi.kylix
Message-ID <[email protected]>
On Friday 07 February 2003 11:38 am, Alberto Narduzzi wrote:
> Hello...
>
> after a looong time reading, time has come for me to write something with
> Kylix. Wll, actually porting a project form Delphi 5 to Kylix 3 OE.
>
> Problem:
>
> under Windows I used to write something like the following, to set a
> clipping area on a tcanvas, so that nothing would be drawn outside the
> bounds:
>
> ClipRgn:=CreateRectRgn(FViewPortRect.Left, FViewPortRect.Top,
> FViewPortRect.Right+1, FViewPortRect.Bottom+1);
>
> SelectClipRgn(ImgScreen.Canvas.Handle, ClipRgn);
>
> but with Kylix such functions don't exist. So my question is: how do I
> "translate" the above code to gain the same result with Kylix? (provided I
> already tried to use some QTsomething... and QRegionH in place of HRGN with
> no results)
>

Hi,

I'm not sure I follow you;

Canvas.SetClipRect(Trect);

definitely exists....

The only caveat with GetClipRect and SetClipRect is that it is often necessary 
to lock the canvas before using them.

-- 
adam





------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/LIgTpC/vN2EAA/xGHJAA/i7folB/TM
---------------------------------------------------------------------~->

-------------------------------------------------------
Forum / mailing list for Borland Kylix programmers
Our web page:  http://groups.yahoo.com/group/kylixgroup
To join the forum: [email protected]
To unsubscribe:  [email protected]
To post your messages:       [email protected]
To contact the moderator:  [email protected]
------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/