Re: Problem drawing directly to bitmap rep using NSGraphicsContext
Re: Problem drawing directly to bitmap rep using NSGraphicsContext
- Subject: Re: Problem drawing directly to bitmap rep using NSGraphicsContext
- From: Erik Buck <email@hidden>
- Date: Tue, 28 Nov 2006 10:34:07 -0800 (PST)
You seem very confused and on the wrong path. No offence intended, but I am trying to determine what level of assistance you need: Have you ever done any programming before ? Do you understand the concepts of variables, storage, pointers, and global graphics state ?
How about this code ?
NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:[NSData dataWithContentsOfFile:path]];
NSGraphicsContext *imageRepContext = [NSGraphicsContext graphicsContextWithBitmapImageRep:imageRep];
NSGraphicsContext *originalContext = [NSGraphicsContext currentContext];
[NSGraphicsContext setCurrentContext:imageRepContext]; // Future drawing goes to the image rep
// Do any drawing you want. imageRep already contains the image loaded from path
// based on your example, there is no more work to do.
[NSGraphicsContext setCurrentContext:originalContext]; // put things back the way you found them
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden