• 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
3rd unwanted contex
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

3rd unwanted contex


  • Subject: 3rd unwanted contex
  • From: Lorenzo <email@hidden>
  • Date: Mon, 24 Apr 2006 17:45:57 +0200

Hi,
I export an animation (a series of images) to a QT movie.
I need to copy each frame from an rgba inputContext
to an argb outputContext so I can even scale down the output images with
antialias. I use CG and it works properly. Only I don't understand why I
need to create and release a new 3rd gFinalContext for any frame exported.
In facts if I draw the inputImage directly into the outputContext or I reuse
the gFinalContext, it doesn't work. I see always the first image.


- (void)CopyInputBufferToOutputBuffer
// to be called to export each frame to QT
{
    if(gFinalContext == nil){

        gFinalContext = CGBitmapContextCreate(argbBuffer,width, height,
                        kBitsPerComponent, sBytesPerRow, gColorSpace,
                        sAlphaInfo);
    }

    CGContextClearRect(gFinalContext, gFinalBounds);
    CGContextClearRect(outputContext, gFinalBounds);
    CGContextDrawImage(gFinalContext, gFinalBounds, inputImage);

    // If I comment the next two lines, it doesn't work anymore
    // I see just the first image instead of all the images, one by one.
    CGContextRelease(gFinalContext);
    gFinalContext = nil;

    [exportMonitorView display];
}


I think it should work with just:
    CGContextDrawImage(outputContext, gFinalBounds, inputImage);


Best Regards
--
Lorenzo
email: email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Custom view - newbie stumped
  • Next by Date: Re: Animated split view collapsing
  • Previous by thread: RE: Custom view - newbie stumped
  • Next by thread: Frameworks, I need to make one...
  • Index(es):
    • Date
    • Thread