本文整理汇总了C#中Gdk.Pixbuf.CopyArea方法的典型用法代码示例。如果您正苦于以下问题:C# Pixbuf.CopyArea方法的具体用法?C# Pixbuf.CopyArea怎么用?C# Pixbuf.CopyArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdk.Pixbuf
的用法示例。
在下文中一共展示了Pixbuf.CopyArea方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TransformAndCopy
public static Gdk.Rectangle TransformAndCopy (Gdk.Pixbuf src, Gdk.Pixbuf dest, PixbufOrientation orientation, Gdk.Rectangle args)
{
Gdk.Rectangle area = TransformOrientation (src, args, orientation);
int step = 256;
Gdk.Rectangle rect = new Gdk.Rectangle (args.X, args.Y,
Math.Min (step, args.Width),
Math.Min (step, args.Height));
Gdk.Rectangle trect = TransformOrientation (src, rect, orientation);
Gdk.Pixbuf tmp = new Gdk.Pixbuf (src.Colorspace, src.HasAlpha,
src.BitsPerSample,
trect.Width, trect.Height);
Gdk.Rectangle subarea;
BlockProcessor proc = new BlockProcessor (args, 256);
while (proc.Step (out subarea)) {
Gdk.Rectangle trans = TransformOrientation (src, subarea, orientation);
Gdk.Pixbuf ssub = new Gdk.Pixbuf (src, subarea.X, subarea.Y,
subarea.Width, subarea.Height);
Gdk.Pixbuf tsub = new Gdk.Pixbuf (tmp, 0, 0, trans.Width, trans.Height);
CopyWithOrientation (ssub, tsub, orientation);
tsub.CopyArea (0, 0, trans.Width, trans.Height, dest, trans.X, trans.Y);
ssub.Dispose ();
tsub.Dispose ();
}
tmp.Dispose ();
return area;
}
示例2: Process
protected override Pixbuf Process(Pixbuf input, Cms.Profile input_profile)
{
Rectangle selection = FSpot.Utils.PixbufUtils.TransformOrientation ((int)State.PhotoImageView.PixbufOrientation <= 4 ? input.Width : input.Height,
(int)State.PhotoImageView.PixbufOrientation <= 4 ? input.Height : input.Width,
State.Selection, State.PhotoImageView.PixbufOrientation);
Pixbuf edited = new Pixbuf (input.Colorspace,
input.HasAlpha, input.BitsPerSample,
selection.Width, selection.Height);
input.CopyArea (selection.X, selection.Y,
selection.Width, selection.Height, edited, 0, 0);
return edited;
}
示例3: Process
protected override Pixbuf Process (Pixbuf input, Cms.Profile input_profile) {
Pixbuf edited = new Pixbuf (input.Colorspace,
input.HasAlpha, input.BitsPerSample,
State.Selection.width, State.Selection.height);
input.CopyArea (State.Selection.x, State.Selection.y,
State.Selection.width, State.Selection.height, edited, 0, 0);
return edited;
}
示例4: CrossFade
private Pixbuf CrossFade (Pixbuf current, Pixbuf prev, Pixbuf next, double percent)
{
Rectangle area = new Rectangle (0, 0, Allocation.Width, Allocation.Height);
BlockProcessor proc = new BlockProcessor (area, 256);
Rectangle subarea;
while (proc.Step (out subarea)) {
if (IsRealized)
GdkWindow.ProcessUpdates (false);
prev.CopyArea (subarea.X, subarea.Y, subarea.Width, subarea.Height, current, subarea.X, subarea.Y);
next.Composite (current, subarea.X, subarea.Y, subarea.Width, subarea.Height, 0, 0, 1, 1,
Gdk.InterpType.Nearest, (int) System.Math.Round (255 * percent));
}
return current;
}
示例5: ScaleIcon
private Pixbuf ScaleIcon(Pixbuf icon)
{
if (icon.Width > Size) {
return icon.ScaleSimple (Size, Size, InterpType.Bilinear);
}
var scaled_icon = new Pixbuf (Colorspace.Rgb, true, 8, Size, Size);
scaled_icon.Fill (0xffffff00);
int x_offset = (Size - icon.Width) / 2;
int y_offset = (Size - icon.Height) / 2;
icon.CopyArea (0, 0, icon.Width, icon.Height, scaled_icon, x_offset, y_offset);
return scaled_icon;
}