NSImageView Update
NSImageView Update
- Subject: NSImageView Update
- From: Beat Birkhofer <email@hidden>
- Date: Fri, 2 May 2003 16:48:44 +0200
hi
I use an NSImageView to display an image that should be updated
several times during data (for the image) is acquired.
The Initialisation:
scanImage = [[NSImage alloc] initWithSize:NSMakeSize(0.0, 0.0)];
imgRep = nil /* imgRep is an NSBitmapImageRep */
The Update:
if (imgRep != nil)
[scanImage removeRepresentation:imgRep];
imgRep = [[[NSBitmapImageRep alloc]
/* .... */
autorelease];
[scanImage addRepresentation:imgRep];
[imageView setImage:nil]; /* Workaround!!! */
[imageView setImage:scanImage];
Problem: Without the '[imageView setImage:nil];' the display is
updated only the very first time (or never if this message is sent in
the initialisation). The image with the current data is then only
displayed if the window containing the NSImageView is resized. I
tried about all possibilities of setNeedsDisplay and even display.
Any explications or alternative ways to update the NSImageView?
Regards
Beat H.
_______________________________________________
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.