• 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: NSImage or CIImage? Resolution problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage or CIImage? Resolution problem


  • Subject: Re: NSImage or CIImage? Resolution problem
  • From: Stephane Sudre <email@hidden>
  • Date: Tue, 1 Aug 2006 19:21:13 +0200


On 1 août 06, at 19:08, Bill So wrote:

Dear All,

I am a bit new to graphics programming.  I am trying to display an
image in a customer NSView.

The custom NSView is very simple.  It just displays an image in the
drawRect: method like below:
	sampleImage = [NSImage imageNamed:@"myimage.jpg"];
	[sampleImage compositeToPoint:NSMakePoint(0.0, 0.0)
operation:NSCompositeSourceOver];

sampleImage is an NSImage object.

sampleImage is from a JPG file which was obtained from my DC.  (And I
scaled it down to 800 x 600)

Below is the info. of the image in "Preview" app.

	File Name	myimage.jpg
	Document Type	JPEG Image
	File Size	218439 bytes
	Color Model	RGB
	Depth	8
	DPI Height	300
	DPI Width	300
	Orientation	1
	Pixel Height	600
	Pixel Width	800
	Profile Name	Camera RGB Profile

When I call [sampleImage size], the returned size is not 800 x 600.
It is 192 x 144.  How do I get NSImage use the exact pixel size? (i.e.
800 x 600)

http://developer.apple.com/documentation/Cocoa/Conceptual/ CocoaDrawingGuide/Images/chapter_7_section_2.html#//apple_ref/doc/uid/ TP40003290-CH208-SW2

Read the doc above but it just gives too little info for what I need to know...

Please kindly advise.

NSImageRep * thisIsAImageRep=[[myImageWhichIsNoySeventyTwoDPI representations] objectAtIndex:0];


[thisIsAImageRep pixelsHigh];

[thisIsAImageRep pixelsWide];
_______________________________________________
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: Re: NSImage or CIImage? Resolution problem
      • From: "Bill So" <email@hidden>
References: 
 >NSImage or CIImage? Resolution problem (From: "Bill So" <email@hidden>)

  • Prev by Date: How to make KVO's 'addObserver' survive program restart?
  • Next by Date: Re: NSTabView and edit fields
  • Previous by thread: NSImage or CIImage? Resolution problem
  • Next by thread: Re: Re: NSImage or CIImage? Resolution problem
  • Index(es):
    • Date
    • Thread