> On Nov 2, 2020, at 3:20 PM, Carl Hoefs <newsli...@autonomy.caltech.edu> wrote: > > Okay. It was my understanding that -TIFFRepresentation was the only way to > get serializable image data bytes... What is a more efficient way to do this?
If you want serializable data bytes, sure, but thats not what you appear to be doing in the code you sent – you appear to want a bitmap representation. Presumably you go on to do something other than serialize it (as I imagine you want to draw it in some way). In general if you want something you can draw, you can get a -CGImageForProposedRect:context:hints, and if you need an NSBitmapRep you can use -bestRepresentationForRect:context:hints:. But assuming your trying to get that NSImage somewhere other than into (say) an NSImageView, there may be better APIs or pathways to that solution. > -Carl > > >> On Nov 2, 2020, at 3:09 PM, David Duncan <david.dun...@apple.com >> <mailto:david.dun...@apple.com>> wrote: >> >> Also any code using -TIFFRepresentation for any reason other than to get >> actual TIFF data is likely suspect. There are absolutely more efficient ways >> to do this. > _______________________________________________ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com