Discussion:
NSImageView display problem
Abhijeet Singh
2012-06-13 06:59:33 UTC
Permalink
Hi,In my application I am displaying an image received from some third party camera library function in NSImageView on screen. On "Capture" button click the image is first saved on hard disk and then I display that image on screen. It works fine during the first time when I start my application. But when I close the window (not the application) that has NSImageView and comes back later the NSImageView stops updating. On Capture button click the new image is created on hard disk but NSImageView keeps showing the previous run's image. I am using a modal window here. I even tried to clear the NSImageView on window close button click (using [imageView setImage:nil] ) but still screen shows the old image when i open the window next time.This is what I am doing on Capture button click Create CameraImage.tiff file using third party camera library. (The image is always saved with same name hence overwritten.) Display image in NSImageView. Here is the code for displaying the image (vo
id)displayCapturedImage:(char *)imgname contrastvalue:(double) camcontrast{NSImage *image;image = [[NSImage alloc] initWithContentsOfFile:[NSString stringWithCString:imgname encoding: NSUTF8StringEncoding]] ; [calibChipView setImage:image];[calibChipView setNeedsDisplay:YES];//show the contrast value [contrastfield setIntValue:(int) camcontrast];[contrastfield setNeedsDisplay: YES];[image release];}RegardsAbhijeetDear macosxdev ! Get Yourself a cool, short @in.com Email ID now!
Loading...