本文整理汇总了C#中Gdk.Pixbuf.SaturateAndPixelate方法的典型用法代码示例。如果您正苦于以下问题:C# Pixbuf.SaturateAndPixelate方法的具体用法?C# Pixbuf.SaturateAndPixelate怎么用?C# Pixbuf.SaturateAndPixelate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdk.Pixbuf
的用法示例。
在下文中一共展示了Pixbuf.SaturateAndPixelate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawCell
void DrawCell (int c, int r, int item)
{
if (adapter == null)
return;
Pixbuf image = adapter[item];
if (image == null)
return;
#if DORKY_HIGHLIGHT
Console.WriteLine ("{0} {1} // {2} {3} // {4}", c, r, mouse_col, mouse_row, highlight_mouse);
if (c == mouse_col && r == mouse_row && highlight_mouse){
Pixbuf original = image;
image = new Pixbuf (original.Colorspace, original.HasAlpha, original.BitsPerSample,
original.Width, original.Height);
original.CopyArea (0, 0, original.Width, original.Height, image, 0, 0);
image.SaturateAndPixelate (image, 4.0f, false);
}
#endif
int x = c * cell_width + margin_left;
int y = r * cell_height + margin_top;
int iw = (int) Math.Min (image.Width * zoom, icon_width);
int ih = (int) Math.Min (image.Height * zoom, icon_height);
x += (icon_width - iw) / 2;
y += (icon_height - ih) / 2;
// paint over any possible old selection
if (!Selection.Get (item)) {
for (int i = 0; i < 5; i++) {
window.DrawRectangle
(bkgr_gc, false,
x - i - 1, y - i - 1,
iw + i * 2 + 1, ih + i * 2 + 1);
}
}
if (iw != image.Width || ih != image.Height) {
using (Gdk.Pixbuf scaled_image = image.ScaleSimple (iw, ih, InterpType.Tiles)) {
Console.WriteLine ("scalesimple pixbuf is at 0x" + scaled_image.Handle.ToInt32().ToString("x"));
scaled_image.RenderToDrawable (window, white_gc,
0, 0, x, y, iw, ih,
Gdk.RgbDither.None, 0, 0);
}
} else {
image.RenderToDrawable (
window, white_gc,
0, 0, x, y, iw, ih, Gdk.RgbDither.None, 0, 0);
}
// then draw any selection
if (Selection.Get (item)) {
window.DrawRectangle (selection_gc, false,
x - 4, y - 4,
iw + 7, ih + 7);
}
}