本文整理汇总了C#中Gdk.Pixbuf.RenderPixmapAndMask方法的典型用法代码示例。如果您正苦于以下问题:C# Pixbuf.RenderPixmapAndMask方法的具体用法?C# Pixbuf.RenderPixmapAndMask怎么用?C# Pixbuf.RenderPixmapAndMask使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdk.Pixbuf
的用法示例。
在下文中一共展示了Pixbuf.RenderPixmapAndMask方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: drawTileset
//level must be declared prior to calling this
public void drawTileset()
{
_tilesetCache = new Gdk.Pixbuf(_editLevel.tilesetPath);
Pixmap pMap, mask;
_tilesetCache.RenderPixmapAndMask (out pMap, out mask, 0);
int imgWidth = _tilesetCache.Width,
imgHeight = _tilesetCache.Height;
_tilesetEventBox.SetSizeRequest (imgWidth, imgHeight);
tilesetDrawPane.SetSizeRequest (imgWidth, imgHeight);
if (_tilesetGrid) {
//get the context we're drawing in
Gdk.GC gc = new Gdk.GC (levelDrawPane.GdkWindow);
//draw the grid
for (int x = 0; x < imgWidth; x += _editLevel._tileWidth)
pMap.DrawLine (gc, x, 0, x, imgHeight);
for (int y = 0; y < imgHeight; y += _editLevel._tileHeight)
pMap.DrawLine (gc, 0, y, imgWidth, y);
}
tilesetDrawPane.SetFromPixmap (pMap, mask);
//----------------------
}
示例2: SetSplashBG
void SetSplashBG()
{
string[] files;
if (showChristmasSplash)
files = Directory.GetFiles("./icons/splash/christmas");
else
files = Directory.GetFiles("./icons/splash");
Random rand = new Random();
int idx = rand.Next(files.Length);
Pixbuf test = new Pixbuf(files[idx], 744, 600);
Pixmap image,mask;
this.DoubleBuffered = false;
test.RenderPixmapAndMask(out image, out mask, 175);
this.DoubleBuffered = true;
this.AppPaintable = true;
this.GdkWindow.SetBackPixmap(image, false);
this.ShapeCombineMask(mask, 0, 0);
this.GdkWindow.InvalidateRect(new Rectangle(0,0, 744,600), true);
if (showChristmasSplash)
{
for(int idx2 = 0; idx2 < christmasBG.Length; idx2++)
{
Pixbuf test2 = new Pixbuf(christmasBG[idx2], 744, 600);
Pixmap image2,mask2;
test2.RenderPixmapAndMask(out image2, out mask2, 175);
backgrounds[idx2] = image2;
masks[idx2] = mask2;
}
}
}