• 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
Re: CGImage failing to animate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGImage failing to animate


  • Subject: Re: CGImage failing to animate
  • From: Marcel Weiher <email@hidden>
  • Date: Sat, 27 Jul 2002 19:16:02 +0200

On Saturday, July 27, 2002, at 06:39 Uhr, Colin Klipsch wrote:

The animation /does/ work correctly when I don't use CoreGraphics, but instead use an NSBitmapImageRep, along with the appropriate lines of supporting code. The problem therefore must be in my use or misuse of CoreGraphics. (And yes, I need the CoreGraphics way I'm afraid; I can't revert to the older technique.)

- (void)drawRect:(NSRect)dirtyRect
{
CGRect rect = {0, 0, kWidth, kHeight};
CGContextRef context = [[NSGraphicsContext
graphicsContextWithWindow:[self window]] graphicsPort];

This is wrong. You don't want to create graphics contexts, you want to use the current one.

CGContextref context = [[NSGraphicsContext currentContext] graphicsPort];

Don't know if that will solve it, but it should help.

I am also not sure if just setting the needsDisplay: from a timer is enough. Display updating is done after an event has been processed. I am not sure a timer-firing counts as an event.

Marcel

--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
_______________________________________________
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.

References: 
 >CGImage failing to animate (From: Colin Klipsch <email@hidden>)

  • Prev by Date: (no subject)
  • Next by Date: Re: determining dragging source
  • Previous by thread: CGImage failing to animate
  • Next by thread: Re: Using NSToolbar itemForItemIdentifier properly?
  • Index(es):
    • Date
    • Thread