Re: How do I get a CGContextRef?

2008-11-22 Thread DKJ


On 22-Nov-08, at 19:07 , Henry McGilton (Developer) wrote:


That's the standard way to
obtain the current context within drawRect



OK, I wasn't doing it within drawRect... silly me. I'll give it a try  
and see what happens.


dkj


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: How do I get a CGContextRef?

2008-11-22 Thread Henry McGilton (Developer)


On Nov 22, 2008, at 5:48 PM, DKJ wrote:


On 22-Nov-08, at 17:40 , Ken Ferry wrote:

Take a look here:



Thanks for the reference, but I'm doing this for iPhone, and the  
procedure seems to be different. The compiler doesn't recognise the  
NSGraphicsContext class. I tried using the  
UIGraphicsGetCurrentContext function, but that doesn't work either:  
I get an "invalid context" error when I use it in CGContextStrokeRect.


Are you saying that this doesn't work:

CGContextRef context = UIGraphicsGetCurrentContext();

If so there must be something else going on.That's the standard  
way to

obtain the current context within drawRect

Cheers,
. . . . . . . .Henry


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: How do I get a CGContextRef?

2008-11-22 Thread Roland King

well where are you calling it?

That's the correct function, but only works when there is a graphics  
context set, and that's only inside drawRect: in a UIView.


I wandered through the documentation a little and got reasonably lost,  
it does talk about NSGraphicsContext in there, but remember a lot of  
the documentation was dragged over from OS X and some of the stuff in  
there doesn't exist on iPhone, NSGraphicsContext is one of them. I  
don't see any way to create one for the iPhone window, you can create  
bitmap ones I suspect, I think you need to be in drawRect:, but then  
again, if you're not, why do you want one?


I'm going to have to dive into the whole quartz and drawing code one  
day as I suspect there is a lot of great stuff down there .. but it's  
daunting.


On Nov 23, 2008, at 9:48 AM, DKJ wrote:


On 22-Nov-08, at 17:40 , Ken Ferry wrote:

Take a look here:



Thanks for the reference, but I'm doing this for iPhone, and the  
procedure seems to be different. The compiler doesn't recognise the  
NSGraphicsContext class. I tried using the  
UIGraphicsGetCurrentContext function, but that doesn't work either:  
I get an "invalid context" error when I use it in CGContextStrokeRect.


dkj



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org

This email sent to [EMAIL PROTECTED]


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: How do I get a CGContextRef?

2008-11-22 Thread DKJ

On 22-Nov-08, at 17:40 , Ken Ferry wrote:

Take a look here:



Thanks for the reference, but I'm doing this for iPhone, and the  
procedure seems to be different. The compiler doesn't recognise the  
NSGraphicsContext class. I tried using the UIGraphicsGetCurrentContext  
function, but that doesn't work either: I get an "invalid context"  
error when I use it in CGContextStrokeRect.


dkj



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: How do I get a CGContextRef?

2008-11-22 Thread Ken Ferry
Hi DKJ,

Take a look here:
.

-Ken

On Sat, Nov 22, 2008 at 5:31 PM, DKJ <[EMAIL PROTECTED]> wrote:
> The Overview section of CGContext Reference says "You can obtain a graphics
> context by using Quartz graphics context creation functions...". But it
> doesn't say where to find these functions. They don't appear to be listed in
> CGContext Reference itself, as far as I can see.
>
> I know there are Cocoa methods for this; but where are the Quartz functions?
> I've been trying to find them for ages: very frustrating.
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/kenferry%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


How do I get a CGContextRef?

2008-11-22 Thread DKJ
The Overview section of CGContext Reference says "You can obtain a  
graphics context by using Quartz graphics context creation  
functions...". But it doesn't say where to find these functions. They  
don't appear to be listed in CGContext Reference itself, as far as I  
can see.


I know there are Cocoa methods for this; but where are the Quartz  
functions? I've been trying to find them for ages: very frustrating.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]