Re: Scaling a UIImage
Re: Scaling a UIImage
- Subject: Re: Scaling a UIImage
- From: David Duncan via Cocoa-dev <email@hidden>
- Date: Mon, 02 Nov 2020 15:45:47 -0800
> On Nov 2, 2020, at 3:20 PM, Carl Hoefs <email@hidden> 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 <email@hidden
>> <mailto:email@hidden>> 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 (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