本文整理汇总了C#中Gdk.CopyArea方法的典型用法代码示例。如果您正苦于以下问题:C# Gdk.CopyArea方法的具体用法?C# Gdk.CopyArea怎么用?C# Gdk.CopyArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdk
的用法示例。
在下文中一共展示了Gdk.CopyArea方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}