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


C# Pixbuf.Copy方法代码示例

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


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

示例1: Process

        protected override Pixbuf Process(Pixbuf input, Cms.Profile input_profile)
        {
            Pixbuf output = input.Copy ();

            Pixbuf sub = new Pixbuf (output, State.Selection.X, State.Selection.Y,
                    State.Selection.Width, State.Selection.Height);
            sub.Fill (0x00000000);
            return output;
        }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:9,代码来源:BlackoutEditor.cs

示例2: Process

        protected override Pixbuf Process(Pixbuf input, Cms.Profile input_profile)
        {
            Pixbuf output = input.Copy ();

            Pixbuf sub = new Pixbuf (output, State.Selection.X, State.Selection.Y,
                    State.Selection.Width, State.Selection.Height);
            /* lazy man's pixelate: scale down and then back up */
            Pixbuf down = sub.ScaleSimple (State.Selection.Width/75, State.Selection.Height/75,
                    InterpType.Nearest);
            Pixbuf up = down.ScaleSimple (State.Selection.Width, State.Selection.Height,
                    InterpType.Nearest);
            up.CopyArea (0, 0, State.Selection.Width, State.Selection.Height, sub, 0, 0);
            return output;
        }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:14,代码来源:PixelateEditor.cs

示例3: LoadIcon

		DockySurface LoadIcon (Pixbuf icon, int size)
		{
			DockySurface surface;
			using (Gdk.Pixbuf pixbuf = icon.Copy ().ARScale (size, size)) {
				surface = new DockySurface (pixbuf.Width, pixbuf.Height);
				Gdk.CairoHelper.SetSourcePixbuf (surface.Context, pixbuf, 0, 0);
				surface.Context.Paint ();
			}
			return surface;
		}
开发者ID:Aurora-and-Equinox,项目名称:docky,代码行数:10,代码来源:MenuItemWidget.cs

示例4: ScaleToMaxSize

    public static Pixbuf ScaleToMaxSize(Pixbuf pixbuf, int width, int height, bool upscale = true)
    {
        int scale_width = 0;
        int scale_height = 0;
        double scale = Fit (pixbuf, width, height, upscale, out scale_width, out scale_height);

        Gdk.Pixbuf result;
        if (upscale || (scale < 1.0))
            result = pixbuf.ScaleSimple (scale_width, scale_height, (scale_width > 20) ? Gdk.InterpType.Bilinear : Gdk.InterpType.Nearest);
        else
            result = pixbuf.Copy ();

        return result;
    }
开发者ID:GNOME,项目名称:f-spot,代码行数:14,代码来源:PixbufUtils.cs

示例5: IconEmblem

		public IconEmblem (int position, Pixbuf icon, int size)
		{
			Position = position;
			IconSize = size;
			ForcePixbuf = icon.Copy ();
		}
开发者ID:Aurora-and-Equinox,项目名称:docky,代码行数:6,代码来源:IconEmblem.cs

示例6: SetIconFromPixbuf

		protected void SetIconFromPixbuf (Pixbuf pbuf)
		{
			ForcePixbuf = pbuf.Copy ();
		}
开发者ID:Aurora-and-Equinox,项目名称:docky,代码行数:4,代码来源:IconDockItem.cs

示例7: ScaleToMaxSize

	public static Pixbuf ScaleToMaxSize (Pixbuf pixbuf, int width, int height, bool upscale)
	{
		double scale = Math.Min  (width / (double)pixbuf.Width, height / (double)pixbuf.Height);
		int scale_width = (int)(scale * pixbuf.Width);
		int scale_height = (int)(scale * pixbuf.Height);

		Gdk.Pixbuf result;
		if (upscale || (scale < 1.0))
			result = pixbuf.ScaleSimple (scale_width, scale_height, (scale_width > 20) ? Gdk.InterpType.Bilinear : Gdk.InterpType.Nearest);
		else
			result = pixbuf.Copy ();

		CopyThumbnailOptions (pixbuf, result);

		return result;
	}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:16,代码来源:PixbufUtils.cs


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