• 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
Can't cache image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can't cache image


  • Subject: Can't cache image
  • From: Ben Mackin <email@hidden>
  • Date: Thu, 20 Mar 2003 23:02:51 -0800

I keep getting the error "Can't cache image" running the following code:

NSImage *myNewImage = [[NSImage alloc] initWithSize:NSMakeSize([image1
size].width , [image1 size].height)];
[myNewImage setCacheMode:NSImageCacheNever];
[myNewImage lockFocus];

It gives me the error on the lockFocus line. I am not sure why, or what I
can do to get it to work as it should. Here is the greater look of my code,
so you can get an idea of what I am trying to do:

NSImage *image1 = [[NSImage alloc] initByReferencingFile:[mergeArray
objectAtIndex:(numPages-(i+1))]];

[image1 setScalesWhenResized:YES];
[image1 setSize:NSMakeSize([image1 size].width*(204.0/72.0),[image1
size].height*(196.0/72.0))];

NSImage *myNewImage = [[NSImage alloc] initWithSize:NSMakeSize([image1
size].width , [image1 size].height)];
[myNewImage setCacheMode:NSImageCacheNever];
[myNewImage lockFocus];
[[NSGraphicsContext currentContext] setShouldAntialias:NO];
[[NSGraphicsContext currentContext]
setImageInterpolation:NSImageInterpolationNone];
[image1 drawInRect:NSMakeRect(0, 0, [image1 size].width, [image1
size].height) fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0];
[myNewImage unlockFocus];

Any help on this is much appricaited.

Thanks,
Ben

http://www.shayufilms.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Writing a linked list (From: David Remahl <email@hidden>)

  • Prev by Date: Re: Writing a linked list
  • Next by Date: Re: Altivec problems
  • Previous by thread: Re: Writing a linked list
  • Next by thread: Re: Writing a linked list
  • Index(es):
    • Date
    • Thread