For a different reason, I’ve posted the most complete CGBitmapContext example I’ve seen anywhere (which is why I posted it). You can see it here
http://www.blinddogsoftware.com/goodies/#DontSpillTheBits and customize to your needs. You can ignore the CGLayers, CGImage, and CIImage effects. The bitmap context creation is what you want to look at. > On Jun 23, 2017, at 5:11 PM, Graham Cox <graham....@bigpond.com> wrote: > > >> On 24 Jun 2017, at 1:45 am, Gerriet M. Denkmann <gerri...@icloud.com> wrote: >> >> the image looks fine, but when I write subData to disk, it has 64 x 64 >> pixels. > > > By making the NSBitMapRepresentation yourself, creating a context for it, > drawing to that. > > If you make it yourself using the long-winded but complete initializer, you > have total control. Any of the other ‘convenience’ methods do various things > that you can’t see, are poorly documented, and give unexpected results. Even > when they work today their implementations change and one day might do > something else, suddenly breaking your code. I’ve certainly had that happen > when Retina screen came out for example, and had to go back and do it using > the long initializer so I got what I asked for. > > —Graham > _______________________________________________ > > 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/jeff%40szuhay.org > > This email sent to j...@szuhay.org _______________________________________________ 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