• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem drawing directly to bitmap rep using NSGraphicsContext
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • RE: Problem drawing directly to bitmap rep using NSGraphicsContext
      • From: Vinay Prabhu <email@hidden>
  • Prev by Date: Re: Slightly OT: SIGKILL (force quit) and child process termination
  • Next by Date: Re: Problem drawing directly to bitmap rep using NSGraphicsContext
  • Previous by thread: RE: Problem drawing directly to bitmap rep using NSGraphicsContext
  • Next by thread: RE: Problem drawing directly to bitmap rep using NSGraphicsContext
  • Index(es):
    • Date
    • Thread