NSImageView display problem
"Abhijeet Singh" <[email protected]> Wed, 13 Jun 2012 12:29:33 +0530
| Newsgroups | gmane.comp.macosx.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi,In my application I am displaying an image received from some third pa=
rty camera library function in NSImageView on screen. On "Capture" button=
click the image is first saved on hard disk and then I display that imag=
e on screen. It works fine during the first time when I start my applicat=
ion. But when I close the window (not the application) that has NSImageVi=
ew and comes back later the NSImageView stops updating. On Capture button=
click the new image is created on hard disk but NSImageView keeps showin=
g 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 s=
etImage:nil] ) but still screen shows the old image when i open the windo=
w next time.This is what I am doing on Capture button click Create Camera=
Image.tiff file using third party camera library. (The image is always sa=
ved with same name hence overwritten.) Display image in NSImageView. Here=
is the code for displaying the image (vo
id)displayCapturedImage:(char *)imgname contrastvalue:(double) camcontra=
st{NSImage *image;image =3D [[NSImage alloc] initWithContentsOfFile:[NSSt=
ring stringWithCString:imgname encoding: NSUTF8StringEncoding]] ; [calibC=
hipView setImage:image];[calibChipView setNeedsDisplay:YES];//show the co=
ntrast value [contrastfield setIntValue:(int) camcontrast];[contrastfield=
setNeedsDisplay: YES];[image release];}RegardsAbhijeetDear macosxdev ! G=
et Yourself a cool, short @in.com Email ID now!