Re: Convert JPEG to NSImage
Re: Convert JPEG to NSImage
- Subject: Re: Convert JPEG to NSImage
- From: Ian was here <email@hidden>
- Date: Mon, 1 Aug 2005 14:59:45 -0700 (PDT)
That does work! I'm surprised it could be so simple.
Thanks!
--- Philip Dow <email@hidden> wrote:
> Ivan, I believe you can bypass the bitmap and just
> use NSImage like so:
>
> NSImage *tempImage = [[NSImage alloc]
> initWithData:pictData];
>
> I know I'm doing this in a couple of methods where
> I'm reading the
> pictData in from a jpeg file. I don't see why that
> wouldn't work with
> pasteboard data or any other source though.
>
> -Phil
>
> Am 01.08.2005 um 22:23 schrieb Ian was here:
>
> > Does anyone have any sample code for converting
> JPEG
> > data into TIFF data that can be used for an
> NSImage.
> > I've googled and experimented and have not found a
> > solution to this problem.
> >
> >
> >
> > NSBitmapImageRep *bmRep = [NSBitmapImageRep
> > imageRepWithData:imageData];
> >
> > NSImage *thumbnailImage = [[NSImage alloc]
> > initWithSize:NSMakeSize( (float)[bmRep
> pixelsWide],
> > (float)[bmRep pixelsHigh] )];
> >
> >
> > [thumbnailImage lockFocus];
> >
> > [bmRep drawInRect:NSMakeRect( 0.0, 0.0,
> > [thumbnailImage size].width, [thumbnailImage
> > size].height )];
> >
> > [thumbnailImage unlockFocus];
> >
> >
> >
> >
> ____________________________________________________
> > Start your day with Yahoo! - make it your home
> page
> > http://www.yahoo.com/r/hs
> >
> > _______________________________________________
> > Do not post admin requests to the list. They will
> be ignored.
> > Cocoa-dev mailing list
> (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> >
>
> >
> > This email sent to email@hidden
> >
> >
>
> _______________________________________________
> Do not post admin requests to the list. They will be
> ignored.
> Cocoa-dev mailing list
> (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
>
> This email sent to email@hidden
>
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden