public bool Convert (FilterRequest req) { string source = req.Current.LocalPath; Uri dest = req.TempUri (Path.GetExtension (source)); using (ImageFile img = ImageFile.Create (source)) { using (Pixbuf pixbuf = img.Load ()) { using (ImageInfo info = new ImageInfo (pixbuf)) { MemorySurface surface = new MemorySurface (Format.Argb32, pixbuf.Width, pixbuf.Height); Context ctx = new Context (surface); ctx.Matrix = info.Fill (info.Bounds, angle); Pattern p = new SurfacePattern (info.Surface); ctx.Source = p; ctx.Paint (); ((IDisposable)ctx).Dispose (); p.Destroy (); using (Pixbuf result = CairoUtils.CreatePixbuf (surface)) { using (Stream output = File.OpenWrite (dest.LocalPath)) { img.Save (result, output); } } surface.Flush (); info.Dispose (); req.Current = dest; return true; } } } }
protected virtual void Dispose(bool disposing) { if (disposed) { return; } disposed = true; if (disposing) { // free managed resources if (mask != null) { mask.Dispose(); mask = null; } if (blur != null) { blur.Dispose(); blur = null; } } // free unmanaged resources }
public void Dispose() { if (mask != null) { mask.Destroy(); } if (blur != null) { blur.Dispose(); } }
public void Dispose() { if (begin_buffer != null) { begin_buffer.Dispose(); begin_buffer = null; } if (end_buffer != null) { end_buffer.Dispose(); end_buffer = null; } }
protected override void OnDestroyed() { if (current != null) { current.Dispose(); current = null; } if (next != null) { next.Dispose(); next = null; } Transition = null; if (effect != null) { effect.Dispose(); } base.OnDestroyed(); }
public void Dispose() { buffer.Dispose(); }
public void Dispose() { begin_buffer.Dispose(); end_buffer.Dispose(); }