当前位置: 首页>>代码示例>>C#>>正文


C# Context.Dispose方法代码示例

本文整理汇总了C#中Cairo.Context.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Context.Dispose方法的具体用法?C# Context.Dispose怎么用?C# Context.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cairo.Context的用法示例。


在下文中一共展示了Context.Dispose方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateSurfaceForPixbuf

        public static Surface CreateSurfaceForPixbuf (Context cr, Pixbuf pixbuf)
        {
			Surface surface;
			using (var t = cr.GetTarget ()) {
				surface = t.CreateSimilar (t.Content, pixbuf.Width, pixbuf.Height);
			}
			using (Context surface_cr = new Context (surface)) {
				CairoHelper.SetSourcePixbuf (surface_cr, pixbuf, 0, 0);
				surface_cr.Paint ();
				surface_cr.Dispose ();
			}
            return surface;
        }
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:13,代码来源:CairoExtensions.cs

示例2: CreateBlur

        ImageInfo CreateBlur(ImageInfo source)
        {
            double scale = Math.Max (256 / (double)source.Bounds.Width,
                               256 / (double)source.Bounds.Height);

            var small = new Gdk.Rectangle (0, 0,
                                      (int)Math.Ceiling (source.Bounds.Width * scale),
                                      (int)Math.Ceiling (source.Bounds.Height * scale));

            var image = new ImageSurface (Format.Argb32,
                                     small.Width,
                                     small.Height);

            var ctx = new Context (image);

            ctx.Matrix = source.Fit (small);
            ctx.Operator = Operator.Source;
            Pattern p = new SurfacePattern (source.Surface);
            ctx.SetSource (p);

            ctx.Paint ();
            p.Dispose ();
            ctx.Dispose ();

            ImageInfo overlay = null;
            using (var normal = image.ToPixbuf ())
            {
                using (var pixbufBlur = PixbufUtils.Blur (normal, 3, null))
                {
                    overlay = new ImageInfo (pixbufBlur);
                }
            }

            image.Dispose ();
            return overlay;
        }
开发者ID:modulexcite,项目名称:f-spot,代码行数:36,代码来源:SoftFocus.cs

示例3: GenerateStub

 private ImageSurface GenerateStub()
 {
     ImageSurface stub = new ImageSurface (Format.ARGB32, 600, 300);
     Context cairo  = new Context(stub);
     cairo.IdentityMatrix ();
     cairo.Scale (600,300);
     cairo.Rectangle (0, 0, 1, 1);
     cairo.SetSourceRGB (1,1,1);
     cairo.Fill ();
     cairo.MoveTo (0.14, 0.5);
     cairo.SetFontSize (0.08);
     cairo.SetSourceRGB (0, 0, 0);
     cairo.ShowText ("Загрузите подложку");
     cairo.Dispose ();
     return stub;
 }
开发者ID:QualitySolution,项目名称:LeaseAgreement,代码行数:16,代码来源:PlanViewWidget.cs

示例4: ImageInfo

        public ImageInfo(ImageInfo info, Gdk.Rectangle allocation)
        {
            Surface = info.Surface.CreateSimilar (Content.Color,
                                  allocation.Width,
                                  allocation.Height);

            var ctx = new Context (Surface);
            Bounds = allocation;

            ctx.Matrix = info.Fill (allocation);
            Pattern p = new SurfacePattern (info.Surface);
            ctx.SetSource (p);
            ctx.Paint ();
            ctx.Dispose ();
            p.Dispose ();
        }
开发者ID:modulexcite,项目名称:f-spot,代码行数:16,代码来源:ImageInfo.cs

示例5: UpdateCache

        protected override void UpdateCache(Context ctx)
        {
            Rectangle rb = Slot + Parent.ClientRectangle.Position;

            using (ImageSurface cache = new ImageSurface (bmp, Format.Argb32, Slot.Width, Slot.Height, 4 * Slot.Width)) {
                Context gr = new Context (cache);

                if (Clipping.count > 0) {
                    Clipping.clearAndClip (gr);

                    onDraw (gr);
                }

                gr.Dispose ();

                ctx.SetSourceSurface (cache, rb.X, rb.Y);
                ctx.Paint ();
            }
            Clipping.Reset();
        }
开发者ID:jpbruyere,项目名称:Crow,代码行数:20,代码来源:PrivateContainer.cs

示例6: UpdateCache

        protected override void UpdateCache(Context ctx)
        {
            Rectangle rb = Slot + Parent.ClientRectangle.Position;

            using (ImageSurface cache = new ImageSurface (bmp, Format.Argb32, Slot.Width, Slot.Height, 4 * Slot.Width)) {
                Context gr = new Context (cache);

                if (Clipping.count > 0) {
                    Clipping.clearAndClip (gr);
                    base.onDraw (gr);

                    //clip to client zone
                    CairoHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius);
                    gr.Clip ();

                    foreach (GraphicObject c in Children) {
                        if (!c.Visible)
                            continue;
                        if (Clipping.intersect(c.Slot + ClientRectangle.Position))
                            c.Paint (ref gr);
                    }

                    #if DEBUG_CLIP_RECTANGLE
                    Clipping.stroke (gr, Color.Amaranth.AdjustAlpha (0.8));
                    #endif
                }
                gr.Dispose ();

                ctx.SetSourceSurface (cache, rb.X, rb.Y);
                ctx.Paint ();
            }
            Clipping.Reset();
        }
开发者ID:jpbruyere,项目名称:Crow,代码行数:33,代码来源:Group.cs


注:本文中的Cairo.Context.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。