Hi,

I'm trying for days to work with the CoreImage framework. My app let's the
user take pictures and publishes them to a cloud server. To make the
pictures a little bit more interesting I use CoreImage filters. Now, when
using the filters a couple time in row the app crashes. 

To eliminate own faults in my code I've tried the Adjust Contrast and
Brightness of an Image recipe
http://docs.xamarin.com/ios/recipes/Media/CoreImage/Adjust_Contrast_and_Brightness_of_an_Image

It shows the same behavior: after 5 changes of contrast/brightness on a 5 MB
picture the app crashes. When using the 108 KB 'clouds.jpg' picture provided
with the recipe the app crashes after around 150 changes. So it looks like
it is tied to memory usage 'internally'!?

Here is the code straight from the recipe. 

void HandleValueChanged (object sender, EventArgs e)
{
    if (colorCtrls == null)
        colorCtrls = new CIColorControls () {
            Image = CIImage.FromCGImage (image.CGImage),
        };
    // set the values
    colorCtrls.Brightness = sliderBrightness.Value; 
    colorCtrls.Saturation = sliderSaturation.Value; 
    colorCtrls.Contrast = sliderContrast.Value;
    // do the transformation
    var output = colorCtrls.OutputImage;
    var context = CIContext.FromOptions (null);
    var result = context.CreateCGImage (output, output.Extent);
    // display the result in the UIImageView
    imageView.Image = UIImage.FromImage(result);
}

I've already tried "using" statements around every single call and did a lot
testing with NSAutoReleasePool's and GC.Collect(). Now I've run out of ideas
how to get this working .....

I use MD 3.0.4.6 / MT 5.4.0 / XCode 4.4.1 / iOS 5.1.1 on iPhone 4GS 

Anybody has a suggestion how to proceed from here ???
thanks
Boris




--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/CoreImage-Memory-Consumption-Recipe-affected-tp4656953.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to