[futurebasic] Re: [X-FB] CGContext Rects

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : February 2008 : Group Archive : Group : All Groups

From: Pete Beaumont <furbies@...>
Date: Sat, 23 Feb 2008 23:05:05 +1100
On 23/02/2008, at 10:20 PM, Robert Purves wrote:

>
> maxclass@... wrote:
>
>>>> I have scoured Apples Doc's and do not seem to be able to find  
>>>> the way that one would reset the size of a CGRect once it has  
>>>> been defined.
>>> CGRectMake(), which you already use, sets the four fields of a  
>>> CGRect to its four float arguments.
>>
>> In other words, CGRectMake is not only used to create rects but  
>> also to reset their values.
>
> CGRectMake() does not create anything.
>
>> Now I am trying to figure out how to know where the origin has been  
>> translated to after it has been done.
>> When you have translated the origin to the top left of a window, so  
>> that it is like QD coordinates, and you then resize the window the  
>> origin is no longer at the same place.
>> If you knew what the original offset was you could move the origin  
>> in the opposite direction back to its original location, then reset  
>> it to the new height of the resized windows new content region.
>
>
> Typically a drawing sequence to a window takes a fresh CGContextRef  
> each time, and so none of the above applies:
> QDBeginCGContext(..., @ctx )
> CGContext[Translate|Scale|Rotate]CTM( ctx, ... )
> MyDraw( ctx,... )
> QDEndCGContext(..., @ctx ) // dispose ctx
>
> If you have some special reason (I can't think of one offhand) to  
> recycle a previously-obtained CGContextRef you will have to save the  
> virgin state, then restore after debauching the CTM:
> CGContextSaveGState( ctx )
> CGContext[Translate|Scale|Rotate]CTM( ctx, ... )
> MyDraw( ctx,... )
> CGContextRestoreGState( ctx )
>
> Robert P.
>

debauching the CTM: ?

sounds kinky!

Pete....              the other one

> --
> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...
>