FROM : Nicko van Someren
DATE : Mon Oct 04 18:49:15 2004
On 4 Oct 2004, at 17:40, Nicko van Someren wrote:
> On 4 Oct 2004, at 17:16, Glen Simmons wrote:
>
>> I'm creating an NSImage from some 1 bit bitmap data using
>> -[NSBitmapImageRep initWithBitmapDataPlanes:pixelsWide: ...] method.
>> I then call setScalesWhenResized:YES b/c the NSImageView it's going
>> to is larger than the original. I then set it in my NSImageView with
>> setImage:. Nothing special. The problem is that the image looks fuzzy
>> b/c the NSImageView is antialiasing it for me. How nice, except
>> that's not what I want. And there's not a way to tell NSImageView not
>> to antialias as far as I can see. What am I missing?
>
> I'm not sure that there is a particular way to switch this off in
> NSImageView but subclassing the image view with the following drawing
> method works:
>
> - (void)drawRect:(NSRect)rect { ... }
In fact, come to think of it, subclassing the setUpGState is less
typing and more efficient:
- (void)setUpGState {
[super setUpGState];
[[NSGraphicsContext currentContext] setImageInterpolation:
NSImageInterpolationNone];
}
Nicko
DATE : Mon Oct 04 18:49:15 2004
On 4 Oct 2004, at 17:40, Nicko van Someren wrote:
> On 4 Oct 2004, at 17:16, Glen Simmons wrote:
>
>> I'm creating an NSImage from some 1 bit bitmap data using
>> -[NSBitmapImageRep initWithBitmapDataPlanes:pixelsWide: ...] method.
>> I then call setScalesWhenResized:YES b/c the NSImageView it's going
>> to is larger than the original. I then set it in my NSImageView with
>> setImage:. Nothing special. The problem is that the image looks fuzzy
>> b/c the NSImageView is antialiasing it for me. How nice, except
>> that's not what I want. And there's not a way to tell NSImageView not
>> to antialias as far as I can see. What am I missing?
>
> I'm not sure that there is a particular way to switch this off in
> NSImageView but subclassing the image view with the following drawing
> method works:
>
> - (void)drawRect:(NSRect)rect { ... }
In fact, come to think of it, subclassing the setUpGState is less
typing and more efficient:
- (void)setUpGState {
[super setUpGState];
[[NSGraphicsContext currentContext] setImageInterpolation:
NSImageInterpolationNone];
}
Nicko
| Related mails | Author | Date |
|---|---|---|
| Glen Simmons | Oct 4, 18:16 | |
| Nicko van Someren | Oct 4, 18:40 | |
| Nicko van Someren | Oct 4, 18:49 | |
| Glen Simmons | Oct 4, 19:32 | |
| Nicko van Someren | Oct 4, 20:07 |






Cocoa mail archive

