本文整理汇总了C#中Cairo.Transform方法的典型用法代码示例。如果您正苦于以下问题:C# Cairo.Transform方法的具体用法?C# Cairo.Transform怎么用?C# Cairo.Transform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cairo
的用法示例。
在下文中一共展示了Cairo.Transform方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDrawn
protected override bool OnDrawn(Cairo.Context cr)
{
if (!CairoHelper.ShouldDrawWindow (cr, Window)) {
return base.OnDrawn (cr);
}
if (reflect) {
CairoExtensions.PushGroup (cr);
}
cr.Operator = Operator.Over;
cr.Translate (h_padding, 0);
cr.Rectangle (0, 0, Allocation.Width - h_padding, Math.Max (2 * bar_height,
bar_height + bar_label_spacing + layout_height));
cr.Clip ();
Pattern bar = RenderBar (Allocation.Width - 2 * h_padding, bar_height);
cr.Save ();
cr.Source = bar;
cr.Paint ();
cr.Restore ();
if (reflect) {
cr.Save ();
cr.Rectangle (0, bar_height, Allocation.Width - h_padding, bar_height);
cr.Clip ();
Matrix matrix = new Matrix ();
matrix.InitScale (1, -1);
matrix.Translate (0, -(2 * bar_height) + 1);
cr.Transform (matrix);
cr.Pattern = bar;
LinearGradient mask = new LinearGradient (0, 0, 0, bar_height);
mask.AddColorStop (0.25, new Color (0, 0, 0, 0));
mask.AddColorStop (0.5, new Color (0, 0, 0, 0.125));
mask.AddColorStop (0.75, new Color (0, 0, 0, 0.4));
mask.AddColorStop (1.0, new Color (0, 0, 0, 0.7));
cr.Mask (mask);
mask.Destroy ();
cr.Restore ();
CairoExtensions.PopGroupToSource (cr);
cr.Paint ();
}
if (show_labels) {
cr.Translate ((reflect ? 0 : -h_padding) + (Allocation.Width - layout_width) / 2,
bar_height + bar_label_spacing);
RenderLabels (cr);
}
bar.Destroy ();
return true;
}
示例2: RenderElement
void RenderElement (Cairo.Context context, CanvasElement element)
{
element.Canvas = this;
context.Transform (element.Transform);
element.Render (context);
}
示例3: OnLayoutOutline
protected override void OnLayoutOutline (Cairo.Context context)
{
if (IconOnly) {
context.Transform (box.Transform);
context.Transform (image.Transform);
image.LayoutOutline (context);
} else {
base.OnLayoutOutline (context);
}
}