本文整理汇总了C#中Gdk.RenderPixmapAndMask方法的典型用法代码示例。如果您正苦于以下问题:C# Gdk.RenderPixmapAndMask方法的具体用法?C# Gdk.RenderPixmapAndMask怎么用?C# Gdk.RenderPixmapAndMask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdk
的用法示例。
在下文中一共展示了Gdk.RenderPixmapAndMask方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setBackgroundImage
public static void setBackgroundImage(Gtk.Window win, Gdk.Pixbuf image)
{
Gdk.Pixmap pixmap, pixmap_mask;
image.RenderPixmapAndMask( out pixmap, out pixmap_mask, 255 );
var style = win.Style;
style.SetBgPixmap (StateType.Normal, pixmap);
win.Style = style;
}
示例2: SetWindowShapeFromPixbuf
public static void SetWindowShapeFromPixbuf(Gtk.Window w, Gdk.Pixbuf pixbuf)
{
Pixmap pixmap, pixmask;
pixbuf.RenderPixmapAndMask (out pixmap, out pixmask, 1);
w.ShapeCombineMask (pixmask, 0, 0);
}
示例3: InitializeWindow
// ============================================
// PRIVATE Methods
// ============================================
private void InitializeWindow(Gdk.Pixbuf pixbuf)
{
// Realize Window
this.Realize();
// Set Window Options
this.Decorated = false;
this.Resizable = false;
this.AppPaintable = true;
this.SetSizeRequest(pixbuf.Width, pixbuf.Height);
this.SetDefaultSize(pixbuf.Width, pixbuf.Height);
// Initialize GUI Shape
Gdk.Pixmap maskBitmapWindow;
pixbuf.RenderPixmapAndMask (out this.maskPixmapWindow,
out maskBitmapWindow, 128);
this.Events = Gdk.EventMask.AllEventsMask;
this.ShapeCombineMask(maskBitmapWindow, 0, 0);
// Set Back Pixmap
GdkWindow.SetBackPixmap(this.maskPixmapWindow, false);
GdkWindow.Clear();
// Window Expose Event
this.ExposeEvent += new ExposeEventHandler(OnWindowExpose);
}