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


C# Gdk.Composite方法代码示例

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


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

示例1: FadeIcon

 public static Gdk.Pixbuf FadeIcon(Gdk.Pixbuf source)
 {
     Gdk.Pixbuf result = source.Copy ();
     result.Fill (0);
     result = result.AddAlpha (true, 0, 0, 0);
     source.Composite (result, 0, 0, source.Width, source.Height, 0, 0, 1, 1, Gdk.InterpType.Bilinear, 128);
     return result;
 }
开发者ID:JamesChan,项目名称:mono-addins,代码行数:8,代码来源:Services.cs

示例2: AddIconOverlay

 public static Gdk.Pixbuf AddIconOverlay(Gdk.Pixbuf target, Gdk.Pixbuf overlay)
 {
     Gdk.Pixbuf res = new Gdk.Pixbuf (target.Colorspace, target.HasAlpha, target.BitsPerSample, target.Width, target.Height);
     res.Fill (0);
     target.CopyArea (0, 0, target.Width, target.Height, res, 0, 0);
     overlay.Composite (res, 0, 0, overlay.Width, overlay.Height, 0, 0, 1, 1, Gdk.InterpType.Bilinear, 255);
     return res;
 }
开发者ID:JamesChan,项目名称:mono-addins,代码行数:8,代码来源:Services.cs

示例3: AddOverlay

		void AddOverlay (ref Gdk.Pixbuf icon, Gdk.Pixbuf overlay)
		{
			Gdk.Pixbuf cached = Context.GetComposedIcon (icon, overlay);
			if (cached != null) {
				icon = cached;
				return;
			}
			
			int dx = 2;
			int dy = 2;
			
			Gdk.Pixbuf res = new Gdk.Pixbuf (icon.Colorspace, icon.HasAlpha, icon.BitsPerSample, icon.Width + dx, icon.Height + dy);
			res.Fill (0);
			icon.CopyArea (0, 0, icon.Width, icon.Height, res, 0, 0);
			
			overlay.Composite (res,
				res.Width - overlay.Width,  res.Height - overlay.Height,
				overlay.Width, overlay.Height,
				res.Width - overlay.Width,  res.Height - overlay.Height,
				1, 1, Gdk.InterpType.Bilinear, 255); 
			
			Context.CacheComposedIcon (icon, overlay, res);
			icon = res;
		}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:24,代码来源:VersionControlNodeExtension.cs

示例4: MergeIcons

		//caller should check null and that sizes match
		static Gdk.Pixbuf MergeIcons (Gdk.Pixbuf icon1, Gdk.Pixbuf icon2)
		{
			Gdk.Pixbuf res = new Gdk.Pixbuf (icon1.Colorspace, icon1.HasAlpha, icon1.BitsPerSample, icon1.Width, icon1.Height);
			res.Fill (0);
			icon1.CopyArea (0, 0, icon1.Width, icon1.Height, res, 0, 0);
			icon2.Composite (res, 0, 0, icon2.Width, icon2.Height, 0, 0, 1, 1, Gdk.InterpType.Bilinear, 255);
			return res;
		}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:9,代码来源:ImageService.cs

示例5: MakeTransparent

		public static Gdk.Pixbuf MakeTransparent (Gdk.Pixbuf icon, double opacity)
		{
			Gdk.Pixbuf result = icon.Copy ();
			result.Fill (0);
			result = result.AddAlpha (true, 0, 0, 0);
			icon.Composite (result, 0, 0, icon.Width, icon.Height, 0, 0, 1, 1, Gdk.InterpType.Bilinear, (int)(256 * opacity));
			return result;
		}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:8,代码来源:ImageService.cs

示例6: ScaleToAspect

	public static Gdk.Pixbuf ScaleToAspect (Gdk.Pixbuf orig, int width, int height)
	{
		Gdk.Rectangle pos;
		double scale = Fit (orig, width, height, false, out pos.Width, out pos.Height);
		pos.X = (width - pos.Width) / 2;
		pos.Y = (height - pos.Height) / 2;

		Pixbuf scaled = new Pixbuf (Colorspace.Rgb, false, 8, width, height);
		scaled.Fill (0x000000); 

		orig.Composite (scaled, pos.X, pos.Y, 
				pos.Width, pos.Height,
				pos.X, pos.Y, scale, scale,
				Gdk.InterpType.Bilinear,
				255);

		return scaled;
	}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:18,代码来源:PixbufUtils.cs

示例7: CreateEmblemedPixbuf

 public static Gdk.Pixbuf CreateEmblemedPixbuf(Gdk.Pixbuf icon, Gdk.Pixbuf emblem)
 {
     if (icon == null || emblem == null) return null;
        if (icon.Width <= emblem.Width || icon.Height <= emblem.Height) return null;
        Gdk.Pixbuf dest = new Gdk.Pixbuf(icon.Colorspace, true, icon.BitsPerSample, icon.Width, icon.Height);
        dest.Fill(0x00000000);
        try
        {
     icon.Composite(dest,
     0,
     0,
     dest.Width,
     dest.Height,
     0,
     0,
     1.0,
     1.0,
     Gdk.InterpType.Bilinear,
     255);
     emblem.Composite(dest,
     icon.Width - emblem.Width - 1,
     icon.Height - emblem.Height - 1,
     emblem.Width,
     emblem.Height,
     icon.Width - emblem.Width - 1,
     icon.Height - emblem.Height - 1,
     1.0,
     1.0,
     Gdk.InterpType.Bilinear,
     255);
        }
        catch(Exception e)
        {
     dest = null;
        }
        return dest;
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:37,代码来源:iFolderViewItem.cs

示例8: MakeTransparent

 public Gdk.Pixbuf MakeTransparent(Gdk.Pixbuf icon, double opacity)
 {
     // If somebody knows a better way of doing this, please redo.
     Gdk.Pixbuf gicon = icon.Copy ();
     gicon.Fill (0);
     gicon = gicon.AddAlpha (true,0,0,0);
     icon.Composite (gicon, 0, 0, icon.Width, icon.Height, 0, 0, 1, 1, Gdk.InterpType.Bilinear, (int)(256 * opacity));
     return gicon;
 }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:9,代码来源:IconService.cs

示例9: ExpandImageVertically

		Gdk.Pixbuf ExpandImageVertically (Gdk.Pixbuf img, int newHeight)
		{
			if (newHeight <= img.Height)
				return img.Copy ();
			var res = new Gdk.Pixbuf (img.Colorspace, img.HasAlpha, img.BitsPerSample, img.Width, newHeight);
			var h1 = img.Height / 2;
			var h2 = img.Height - h1;
			res.Fill (0xff000000);
			img.Composite (res, 0, h1, res.Width, newHeight - img.Height, 0, 0, 1, (double)newHeight / (double)img.Height, InterpType.Bilinear, 255);
			img.Composite (res, 0, 0, img.Width, h1, 0, 0, 1, 1, InterpType.Bilinear, 255);
			img.Composite (res, 0, newHeight - h2, img.Width, h2, 0, newHeight - img.Height, 1, 1, InterpType.Bilinear, 255);
			return res;
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:13,代码来源:ButtonBar.cs

示例10: MergeIcons

		//caller should check that sizes match
		public static Gdk.Pixbuf MergeIcons (Gdk.Pixbuf icon1, Gdk.Pixbuf icon2)
		{
			if (icon2 == null)
				return icon1;
			if (icon1 == null)
				return icon2;

			Gdk.Pixbuf res = new Gdk.Pixbuf (icon1.Colorspace, icon1.HasAlpha, icon1.BitsPerSample, icon1.Width, icon1.Height);
			res.Fill (0);
			icon1.CopyArea (0, 0, icon1.Width, icon1.Height, res, 0, 0);
			icon2.Composite (res, 0, 0, icon2.Width, icon2.Height, 0, 0, 1, 1, Gdk.InterpType.Bilinear, 255);

			var icon1_2x = Get2xIconVariant (icon1);
			var icon2_2x = Get2xIconVariant (icon2);

			if (icon1_2x != null || icon2_2x != null) {
				if (icon1_2x == null)
					icon1_2x = ScaleIcon (icon1, icon1.Width * 2, icon1.Height * 2);
				if (icon2_2x == null)
					icon2_2x = ScaleIcon (icon2, icon2.Width * 2, icon2.Height * 2);
				var res2x = MergeIcons (icon1_2x, icon2_2x);
				Set2xIconVariant (res, res2x);
			}

			return res;
		}
开发者ID:telebovich,项目名称:monodevelop,代码行数:27,代码来源:ImageService.cs


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