• 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: Philip Dow <email@hidden>
  • Date: Mon, 1 Aug 2005 22:57:50 +0200

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
  • Follow-Ups:
    • Re: Convert JPEG to NSImage
      • From: Ian was here <email@hidden>
References: 
 >Convert JPEG to NSImage (From: Ian was here <email@hidden>)

  • Prev by Date: Re: Vu-meter
  • Next by Date: Re: Vu-meter
  • Previous by thread: Convert JPEG to NSImage
  • Next by thread: Re: Convert JPEG to NSImage
  • Index(es):
    • Date
    • Thread