本文整理汇总了C#中Cairo类的典型用法代码示例。如果您正苦于以下问题:C#Cairo类的具体用法?C#Cairo怎么用?C#Cairo使用的例子?这里精选的类代码示例或许可以为您提供帮助。
示例1:OnMouseMove
protectedoverridevoidOnMouseMove(objecto,Gtk.MotionNotifyEventArgsargs,Cairo.PointDpoint)
{
if(!is_drawing)
return;
doublex=Utility.Clamp(point.X,0,PintaCore.Workspace.ImageSize.X-1);
doubley=Utility.Clamp(point.Y,0,PintaCore.Workspace.ImageSize.Y-1);
PintaCore.Layers.ShowSelection=true;
ImageSurfacesurf=PintaCore.Layers.ToolLayer.Surface;
using(Contextg=newContext(surf)){
g.Antialias=Antialias.Subpixel;
if(path!=null){
g.AppendPath(path);
(pathasIDisposable).Dispose();
}
g.LineTo(x,y);
path=g.CopyPath();
g.FillRule=FillRule.EvenOdd;
g.ClosePath();
Pathold=PintaCore.Layers.SelectionPath;
PintaCore.Layers.SelectionPath=g.CopyPath();
(oldasIDisposable).Dispose();
}
PintaCore.Workspace.Invalidate();
}
原文链接:
http://www.jxszl.com/biancheng/C/556639.html