• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSImageView Update
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Drag&Dropping in outlineViews
  • Next by Date: Strange Build Error
  • Previous by thread: CGImageRef and PNG image
  • Next by thread: Strange Build Error
  • Index(es):
    • Date
    • Thread