IKImageView -zoomImageToFit causes flicker
IKImageView -zoomImageToFit causes flicker
- Subject: IKImageView -zoomImageToFit causes flicker
- From: Jamie Phelps <email@hidden>
- Date: Wed, 9 Apr 2008 18:55:58 -0500
Hi, all. I'm working with ImageKit, and I've bumped into a problem.
(See below for relevant source.) If I select an image that I've
brought in from the filesystem, the -setIKImageViewImage: method
causes a flickr. I have narrowed it down to the -zoomImageToFit: call.
Without it, there is no flicker.
Moreover, if the image I select in the IKImageBrowserView has been
taken with my MacBook's built-in iSight, the zoom does not cause the
flicker.
Can anyone offer any thoughts about what might be causing the issue? I
was thinking it might possibly be a caching issue, but I can't work
out what the difference would be.
Thanks in advance for any help.
Jamie
- (void) imageBrowserSelectionDidChange:(IKImageBrowserView *) aBrowser{
if(selectedIndex == [[aBrowser selectionIndexes] firstIndex]){
NSLog(@"First index has not changed");
return;
}
selectedIndex = [[aBrowser selectionIndexes] firstIndex];
if(selectedIndex != NSNotFound){
[self setIKImageViewImage:selectedIndex];
} else {
NSLog(@"Selection is empty.");
[mImageView setImageWithURL:nil];
}
}
- (void)setIKImageViewImage:(int)index{
NSImage *mImg;
mImg = [[mImages objectAtIndex:selectedIndex] content];
CGImageSourceRef source;
source = CGImageSourceCreateWithData((CFDataRef)[mImg
TIFFRepresentation], NULL);
CGImageRef newImage = CGImageSourceCreateImageAtIndex(source, 0,
NULL);
[mImageView setImage:newImage imageProperties:nil];
[mImageView zoomImageToFit:nil];
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden