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


C# Cairo.ImageSurface.Destroy方法代码示例

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


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

示例1: Save

        public void Save(string file)
        {
            Cairo.ImageSurface s = new Cairo.ImageSurface (Cairo.Format.Rgb24, project.Details.Width, project.Details.Height);
            Cairo.Context cr = new Cairo.Context (s);
            bool previous = asynchronous;

            asynchronous = false;
            Draw (cr, null);
            asynchronous = previous;

            s.WriteToPng (file);
            ((IDisposable)cr).Dispose ();
            s.Destroy ();
        }
开发者ID:GNOME,项目名称:mistelix,代码行数:14,代码来源:DvdMenu.cs

示例2: GenerateMenus

        string GenerateMenus()
        {
            StringBuilder sb = new StringBuilder (2048);
            Cairo.ImageSurface shigh = new Cairo.ImageSurface (Cairo.Format.ARGB32, project.Details.Width, project.Details.Height);
            Cairo.Context chight = new Cairo.Context (shigh);

            Cairo.ImageSurface snormal = new Cairo.ImageSurface (Cairo.Format.ARGB32, project.Details.Width, project.Details.Height);
            Cairo.Context cnormal = new Cairo.Context (snormal);

            for (int i = 0; i < project.Buttons.Count; i++)
            {
                Button button = (Button)project.Buttons [i];
                sb.Append ("   <button name = \"button" + i + "\"\n");
                sb.Append ("    x0 = \"" + project.Buttons[i].X + "\"\n");
                sb.Append ("    y0 = \"" + project.Buttons[i].Y + "\"\n");
                sb.Append ("    x1 = \"" + (project.Buttons[i].X + button.DrawingBoxWidth) + "\"\n");
                sb.Append ("    y1 = \"" + (project.Buttons[i].Y + button.DrawingBoxHeight) + "\"\n");

                sb.Append ("    down = \"ActionDown\"\n");
                sb.Append ("    up = \"ActionUp\"\n");
                sb.Append ("   />\n");
                DrawButtons (button, chight, cnormal);
            }

            // Quantize the images given
            {
                // See: http://www.cairographics.org/manual/bindings-surfaces.html
                byte [] pixels_normal = QuantizeSurface (snormal);
                Cairo.ImageSurface snormal_quantized =  new Cairo.ImageSurface (ref pixels_normal, snormal.Format, snormal.Width, snormal.Height, snormal.Stride);

                byte [] pixels_high = QuantizeSurface (shigh);
                Cairo.ImageSurface shigh_quantized =  new Cairo.ImageSurface (ref pixels_high, shigh.Format, shigh.Width, shigh.Height, shigh.Stride);

                snormal_quantized.WriteToPng (project.FileToFullPath (menu_normal));
                shigh_quantized.WriteToPng (project.FileToFullPath (menu_highlight));

                snormal_quantized.Destroy ();
                shigh_quantized.Destroy ();
            }

            if (Mistelix.Debugging)
            {
                snormal.WriteToPng (project.FileToFullPath ("menu_normal_unquantized.png"));
                shigh.WriteToPng (project.FileToFullPath ("menu_highlight_unquantized.png"));
            }

            ((IDisposable)cnormal).Dispose ();
            ((IDisposable)chight).Dispose ();
            shigh.Destroy ();
            snormal.Destroy ();
            return sb.ToString ();
        }
开发者ID:GNOME,项目名称:mistelix,代码行数:52,代码来源:Spumux.cs


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