• 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
Re: Convert JPEG to NSImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: Convert JPEG to NSImage (From: Philip Dow <email@hidden>)

  • Prev by Date: Re: plugins
  • Next by Date: NSComboBoxCell looks like NSPopupButtonCell
  • Previous by thread: Re: Convert JPEG to NSImage
  • Next by thread: SVN revision number in CFBundleVersion
  • Index(es):
    • Date
    • Thread