I've managed to make it work using the NSAutoreleasePool inside the for loop
like this:
for( var i = 0; i < c.Pictures.Count; i++ )
{
string path = c.Pictures[i].PicturePath;
string folder = Environment.GetFolderPath(
Environment.SpecialFolder.Personal );
string filename = Path.Combine( folder, c.Name + i + ".png");
if( !File.Exists( filename ) )
{
using( var ns = new NSAutoreleasePool() )
{
NSError err;
using( UIImage img = UIImage.FromFile( path ).Scale(
250,250 ) )
{
img.AsPNG().Save( filename, true, out err );
}
}
}
}
--
View this message in context:
http://monotouch.2284126.n4.nabble.com/Save-UIImage-as-png-from-another-thread-tp4343087p4344226.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch