本文整理汇总了C#中Cairo.ImageSurface.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Cairo.ImageSurface.Dispose方法的具体用法?C# Cairo.ImageSurface.Dispose怎么用?C# Cairo.ImageSurface.Dispose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cairo.ImageSurface
的用法示例。
在下文中一共展示了Cairo.ImageSurface.Dispose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestDrawLine
public void TestDrawLine()
{
var bytes = new byte[1024 * 4];
var format = Cairo.Format.ARGB32;
var image = new Cairo.ImageSurface (bytes, format, 32, 32, 32 * 4);
var shape = new LineShape (0.0, 0.0, 32.0, 32.0);
var look = new Look (SolidBrush.Red, SolidPen.Black);
var op = new ShapeTree (look, shape);
using (var context = new Cairo.Context (image)) {
op.Draw (context);
}
image.WriteToPng ("testimages/line.png");
image.Dispose ();
}
示例2: TestDrawEllipse
public void TestDrawEllipse()
{
var bytes = new byte[1024 * 4];
var format = Cairo.Format.ARGB32;
var image = new Cairo.ImageSurface (bytes, format, 32, 32, 32 * 4);
var shape = new EllipseShape ();
shape.Rectangle = new Rectangle () {
X = 10.0,
Y = 4.0,
Width = 12.0,
Height = 18.0
};
var look = new Look (SolidBrush.Red, SolidPen.Black);
var op = new ShapeTree (look, shape);
using (var context = new Cairo.Context (image)) {
op.Draw (context);
}
image.WriteToPng ("testimages/ellipse.png");
image.Dispose ();
}