• 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
Bundled Image scaled down when displayed (drawAtPoint)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bundled Image scaled down when displayed (drawAtPoint)


  • Subject: Bundled Image scaled down when displayed (drawAtPoint)
  • From: Benjamin Dubois <email@hidden>
  • Date: Sun, 03 Jul 2011 09:00:24 -0700

Hello, all!

Happy 4th of July weekend!

I am currently learning Cocoa/Objective C with XCode 4.0.2 and the 10.6 SDK.
I had started to learn a few Cocoa bits way back when it first showed up
with 10.0 preview (thanks to the student developer program) but ended up
spending most of my programming time in AWT/Swing Java instead.

Here is my issue:
It looks like when I run the app, my bundled image is scaled down to about
75% of it is actual size.

I have tried to look for a reason why my bundled image is scaled down when
displayed via google searches but apparently cant find the right search
terms to find an answer, and none of the sample code and apple documentation
I have seen so far indicate that anything should be done in Interface
Builder.

Is there some kind of resolution setting in InterfaceBuilder for my Custom
NSView element or MainWindow?

Here is what I have in my custom NSView subclass drawRect method :

***

[NSColor blackColor] setFill];

NSRectFill([self bounds]);


NSString* imageName = [[NSBundle mainBundle]

                           pathForResource:@"image1" ofType:@"png"];

    NSLog(@"imageName:%@",imageName);

    NSImage* tempImage = [[NSImage alloc] initWithContentsOfFile:imageName];

    // Draw the image in the current context.

    [tempImage drawAtPoint:point

                fromRect: NSZeroRect

               operation: NSCompositeSourceOver

                fraction: 1.0];



    [tempImage release];

***


Any help, pointer would be greatly appreciated.


Thank you,

Ben
_______________________________________________

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

  • Follow-Ups:
    • Re: Bundled Image scaled down when displayed (drawAtPoint)
      • From: Quincey Morris <email@hidden>
    • Re: Bundled Image scaled down when displayed (drawAtPoint)
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: How to resolve bulk warning "Creating selector for nonexistent method ..."?
  • Next by Date: Re: Line Drawing problem
  • Previous by thread: Re: How to resolve bulk warning "Creating selector for nonexistent method ..."?
  • Next by thread: Re: Bundled Image scaled down when displayed (drawAtPoint)
  • Index(es):
    • Date
    • Thread