Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: erasing, redrawing NSBezierPath into and NSImage problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: erasing, redrawing NSBezierPath into and NSImage problem



Hello...

It looks like you are creating a new image every time drawLabels is called, and you aren't doing anything with it.

Instead of creating a new image, you need to either somehow get a reference to the existing images being used in the matrix and do your redrawing in those images, or after you've created and drawn the images you need to tell the matrix to use them instead of the old images.

Hope that helps,

Louis


Following is my code for drawing the labels:

- (void)drawLabels
{
...
someLabel = [[NSImage alloc] initWithSize:NSMakeSize(cellWidth, cellHeight)];

[someLabel lockFocus];
...
[someLabel unlockFocus];

[labelMatrix setNeedsDisplay: YES];
}


Will
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: erasing, redrawing NSBezierPath into and NSImage problem (From: Wilhelm Phillips <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.