• 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: Image within a custom NSView gets blurrier as I scale
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Image within a custom NSView gets blurrier as I scale


  • Subject: Re: Image within a custom NSView gets blurrier as I scale
  • From: "Frederick C. Lee" <email@hidden>
  • Date: Tue, 11 Apr 2006 13:28:12 -0700

Yes.
I want to be able to scale +/- a bitmap image.
I can do it with the change of size; but the quality deteriorates (upon return to original size).


That is, given the initial scale of 1.0; reduce or enlarge it; return to original 1.0 scale.
The result quality is LESS than the original image.


And the image gets more blurred as you change the scale, back/forth.

So my question is, do I actually need to re-compose the image upon the NSView?
Or, do some sort of NSAffineTransform or something?


What is the efficient (w/out loss of image resolution) way of scaling an image within a NSView (vs. NSImageView)?

Ric.

On Apr 11, 2006, at 12:45 PM, Corey O'Connor wrote:

Are you trying to scale the image to a size greater than it's original
resolution?

-Corey

On 4/10/06, Frederick C. Lee <email@hidden> wrote:
Greetings:
I have an image within a customized NSView via compositeToPoint
method. The bitmap image gets blurrier as I scale it.
How can I maintain the original quality/resolution as I scale?


Regards,

Ric.



=============================
//  EWMainImageView.m
...
- (void)drawRect:(NSRect)rect {
     [super drawRect:rect];

     if (nil != [self image]) {
         [[self image] compositeToPoint:([self bounds].origin)
operation:NSCompositeSourceOver];
     }

     [[NSColor redColor] set];
     [bezierPath stroke];

} // end drawRect().
...
- (void)setScale:(float)factor {
NSSize imageSize = [self origImageSize];
imageSize.width *= factor;
imageSize.height *= factor;
[[self image]setSize:imageSize];
[self setNeedsDisplay:YES];
}
...
===========================
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden



--
-Corey O'Connor


_______________________________________________ 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: Image within a custom NSView gets blurrier as I scale
      • From: Andreas Mayer <email@hidden>
References: 
 >Image within a custom NSView gets blurrier as I scale (From: "Frederick C. Lee" <email@hidden>)
 >Re: Image within a custom NSView gets blurrier as I scale (From: "Corey O'Connor" <email@hidden>)

  • Prev by Date: Re: SLOW -[NSFileManager directoryContentsAtPath:matchingExtension:options:keepExtension:]
  • Next by Date: MightyMouse vs Cocoa
  • Previous by thread: Re: Image within a custom NSView gets blurrier as I scale
  • Next by thread: Re: Image within a custom NSView gets blurrier as I scale
  • Index(es):
    • Date
    • Thread