本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例5: IconEmblem
public IconEmblem (int position, Pixbuf icon, int size)
{
Position = position;
IconSize = size;
ForcePixbuf = icon.Copy ();
}
示例6: SetIconFromPixbuf
protected void SetIconFromPixbuf (Pixbuf pbuf)
{
ForcePixbuf = pbuf.Copy ();
}
示例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;
}