本文整理汇总了C#中Gdk.Inflate方法的典型用法代码示例。如果您正苦于以下问题:C# Gdk.Inflate方法的具体用法?C# Gdk.Inflate怎么用?C# Gdk.Inflate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdk
的用法示例。
在下文中一共展示了Gdk.Inflate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LayoutRoundedRectangle
protected void LayoutRoundedRectangle (Cairo.Context context, Gdk.Rectangle region, int inflateX = 0, int inflateY = 0, float rounding = 3)
{
region.Inflate (inflateX, inflateY);
CairoExtensions.RoundedRectangle (context, region.X + .5, region.Y + .5, region.Width - 1, region.Height - 1, rounding);
}
示例2: RenderBackground
void RenderBackground (Cairo.Context context, Gdk.Rectangle region)
{
region.Inflate (-Padding, -Padding);
context.RenderOuterShadow (new Gdk.Rectangle (region.X + 10, region.Y + 15, region.Width - 20, region.Height - 15), Padding, 3, .25);
context.RoundedRectangle (region.X + 0.5, region.Y + 0.5, region.Width - 1, region.Height - 1, 5);
using (var lg = new LinearGradient (0, region.Y, 0, region.Bottom)) {
lg.AddColorStop (0, new Cairo.Color (.36, .53, .73));
lg.AddColorStop (1, new Cairo.Color (.21, .37, .54));
context.SetSource (lg);
context.FillPreserve ();
}
context.LineWidth = 1;
context.SetSourceRGB (.29, .47, .67);
context.Stroke ();
}
示例3: RenderOuterShadow
// VERY SLOW, only use on cached renders
public static void RenderOuterShadow (this Cairo.Context self, Gdk.Rectangle area, int size, int rounding, double strength)
{
area.Inflate (-1, -1);
size++;
int doubleRounding = rounding * 2;
// left side
self.Rectangle (area.X - size, area.Y + rounding, size, area.Height - doubleRounding - 1);
using (var lg = new LinearGradient (area.X, 0, area.X - size, 0)) {
ShadowGradient (lg, strength);
self.Pattern = lg;
self.Fill ();
}
// right side
self.Rectangle (area.Right, area.Y + rounding, size, area.Height - doubleRounding - 1);
using (var lg = new LinearGradient (area.Right, 0, area.Right + size, 0)) {
ShadowGradient (lg, strength);
self.Pattern = lg;
self.Fill ();
}
// top side
self.Rectangle (area.X + rounding, area.Y - size, area.Width - doubleRounding - 1, size);
using (var lg = new LinearGradient (0, area.Y, 0, area.Y - size)) {
ShadowGradient (lg, strength);
self.Pattern = lg;
self.Fill ();
}
// bottom side
self.Rectangle (area.X + rounding, area.Bottom, area.Width - doubleRounding - 1, size);
using (var lg = new LinearGradient (0, area.Bottom, 0, area.Bottom + size)) {
ShadowGradient (lg, strength);
self.Pattern = lg;
self.Fill ();
}
// top left corner
self.Rectangle (area.X - size, area.Y - size, size + rounding, size + rounding);
using (var rg = new RadialGradient (area.X + rounding, area.Y + rounding, rounding, area.X + rounding, area.Y + rounding, size + rounding)) {
ShadowGradient (rg, strength);
self.Pattern = rg;
self.Fill ();
}
// top right corner
self.Rectangle (area.Right - rounding, area.Y - size, size + rounding, size + rounding);
using (var rg = new RadialGradient (area.Right - rounding, area.Y + rounding, rounding, area.Right - rounding, area.Y + rounding, size + rounding)) {
ShadowGradient (rg, strength);
self.Pattern = rg;
self.Fill ();
}
// bottom left corner
self.Rectangle (area.X - size, area.Bottom - rounding, size + rounding, size + rounding);
using (var rg = new RadialGradient (area.X + rounding, area.Bottom - rounding, rounding, area.X + rounding, area.Bottom - rounding, size + rounding)) {
ShadowGradient (rg, strength);
self.Pattern = rg;
self.Fill ();
}
// bottom right corner
self.Rectangle (area.Right - rounding, area.Bottom - rounding, size + rounding, size + rounding);
using (var rg = new RadialGradient (area.Right - rounding, area.Bottom - rounding, rounding, area.Right - rounding, area.Bottom - rounding, size + rounding)) {
ShadowGradient (rg, strength);
self.Pattern = rg;
self.Fill ();
}
}
示例4: RenderBackground
void RenderBackground (Cairo.Context context, Gdk.Rectangle region)
{
region.Inflate (-Padding, -Padding);
context.RenderOuterShadow (new Gdk.Rectangle (region.X + 10, region.Y + 15, region.Width - 20, region.Height - 15), Padding, 3, .25);
context.RoundedRectangle (region.X + 0.5, region.Y + 0.5, region.Width - 1, region.Height - 1, 5);
using (var lg = new LinearGradient (0, region.Y, 0, region.Bottom)) {
lg.AddColorStop (0, new Cairo.Color (.36, .53, .73));
lg.AddColorStop (1, new Cairo.Color (.21, .37, .54));
context.Pattern = lg;
context.FillPreserve ();
}
context.Save ();
context.Translate (IconPosition.X, IconPosition.Y);
context.Scale (0.75, 0.75);
Gdk.CairoHelper.SetSourcePixbuf (context, starburst, -starburst.Width / 2, -starburst.Height / 2);
context.FillPreserve ();
context.Restore ();
context.LineWidth = 1;
context.Color = new Cairo.Color (.29, .47, .67);
context.Stroke ();
}