本文整理汇总了C#中Gdk.IntersectsWith方法的典型用法代码示例。如果您正苦于以下问题:C# Gdk.IntersectsWith方法的具体用法?C# Gdk.IntersectsWith怎么用?C# Gdk.IntersectsWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdk
的用法示例。
在下文中一共展示了Gdk.IntersectsWith方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public override void Draw(Gdk.Rectangle cliprect)
{
if (!cliprect.IntersectsWith(new Gdk.Rectangle((int) X, (int) Y, (int) Width, (int) Height)))
return;
float left = X;
float right = X + Width;
float top = Y;
float bottom = Y + Height;
float[] current_color = new float[4];
gl.GetFloatv( gl.CURRENT_COLOR, current_color );
//get current color, might be transparent
gl.Color4f(Color.Red, Color.Green, Color.Blue, current_color[3] * Color.Alpha);
gl.Disable(gl.TEXTURE_2D);
gl.Begin(gl.QUADS);
gl.Vertex2f(left, top);
gl.Vertex2f(right, top);
gl.Vertex2f(right, bottom);
gl.Vertex2f(left, bottom);
gl.End();
gl.Enable(gl.TEXTURE_2D);
gl.Color4fv( current_color );
}
示例2: Draw
public override void Draw(Gdk.Rectangle cliprect)
{
if (!cliprect.IntersectsWith((Gdk.Rectangle) Area))
return;
if(Sprite == null)
return;
Sprite.Draw(new Vector(X*32 + 16, Y*32 + 16));
}
示例3: Draw
public override void Draw(Gdk.Rectangle cliprect)
{
if(Sprite == null)
return;
if (cliprect.IntersectsWith((Gdk.Rectangle) Area))
{
Sprite.Draw(new Vector(X, Y));
Sprite.Draw(new Vector(X+Sprite.Width, Y));
}
}
示例4: Draw
public void Draw(Context cr, Gdk.Rectangle clip)
{
cr.LineWidth = style.PenSize;
for(int i = 1; i < count; i++) {
Gdk.Rectangle rect = new Gdk.Rectangle();
rect.X = (int)((x[i] < x[i-1]) ? x[i] : x[i-1]);
rect.Y = (int)((y[i] < y[i-1]) ? y[i] : y[i-1]);
rect.Width = (int)((x[i] < x[i-1]) ? x[i-1]-x[i] : x[i]-x[i-1]);
rect.Height = (int)((y[i] < y[i-1]) ? y[i-1]-y[i] : y[i]-y[i-1]);
if(clip.IntersectsWith(rect)) {
cr.MoveTo(x[i-1], y[i-1]);
cr.LineTo(x[i], y[i]);
LinearGradient g = new LinearGradient(x[i-1], y[i-1], x[i], y[i]);
g.AddColorStop(0.0, color[i-1]);
g.AddColorStop(1.0, color[i]);
cr.Pattern = g;
cr.Stroke();
}
}
}