예제 #1
0
		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;
					}
				}
			}
		}
예제 #2
0
        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
        }
예제 #3
0
        public void Dispose()
        {
            if (mask != null)
            {
                mask.Destroy();
            }

            if (blur != null)
            {
                blur.Dispose();
            }
        }
예제 #4
0
        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();
        }
예제 #6
0
 public void Dispose()
 {
     buffer.Dispose();
 }
예제 #7
0
 public void Dispose()
 {
     begin_buffer.Dispose();
     end_buffer.Dispose();
 }