• 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
Resizing a NSImage in a Cocoa command line tool
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Resizing a NSImage in a Cocoa command line tool


  • Subject: Resizing a NSImage in a Cocoa command line tool
  • From: Dimitri Bouniol <email@hidden>
  • Date: Tue, 05 Aug 2008 02:44:36 -0700

I have been trying relentlessly to resize a NSImage and save it as a png file in a command line tool (not a windowed app, but I included AppKit to get NSImage support). I tried using setScalesWhenResized along with setSize to no avail (image is not resized when saved), and I also tried locking focus to another image and drawing at a smaller size, but that simply crashes with the following:

2008-08-03 20:49:40.127 imagecompressor[16757:10b] _NXCreateWindow: error setting window property (1002)
2008-08-03 20:49:40.132 imagecompressor[16757:10b] _NXPlaceWindow: error setting window shape (1002)
2008-08-03 20:49:40.132 imagecompressor[16757:10b] _NSShapePlainWindow: error setting window shape (1002)
2008-08-03 20:49:40.144 imagecompressor[16757:10b] PScurrentwindowbounds: CGSGetWindowBounds returned error (1002)
Sun Aug 3 20:49:40 imagecompressor[16757] <Error>: CGSImageDataLockDevice: Bad device image source
Sun Aug 3 20:49:40 imagecompressor[16757] <Error>: ripc_DrawWindowContents - Cannot acquire window image
2008-08-03 20:49:40.146 imagecompressor[16757:10b] *** - [NSCachedImageRep representationUsingType:properties:]: unrecognized selector sent to instance 0x116c30
2008-08-03 20:49:40.146 imagecompressor[16757:10b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** - [NSCachedImageRep representationUsingType:properties:]: unrecognized selector sent to instance 0x116c30'
2008-08-03 20:49:40.146 imagecompressor[16757:10b] Stack: (
2527650123,
2500743419,
2527679306,
2527672652,
2527672850,
11646,
10094
)
Trace/BPT trap


I hope someone could come to my aid!
--
定魅刀利
Dimitri Bouniol
email@hidden
http://www.appkainime.com/

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Resizing a NSImage in a Cocoa command line tool
      • From: "Ken Ferry" <email@hidden>
  • Prev by Date: Re: File's Owner problems
  • Next by Date: Re: Properties and memory management
  • Previous by thread: Re: image type of the AdressBook image data
  • Next by thread: Re: Resizing a NSImage in a Cocoa command line tool
  • Index(es):
    • Date
    • Thread