当前位置: 首页>>代码示例>>C#>>正文


C# Shape.intersects方法代码示例

本文整理汇总了C#中Shape.intersects方法的典型用法代码示例。如果您正苦于以下问题:C# Shape.intersects方法的具体用法?C# Shape.intersects怎么用?C# Shape.intersects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Shape的用法示例。


在下文中一共展示了Shape.intersects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: hit

    /**
     * Checks whether or not the specified <code>Shape</code> intersects
     * the specified {@link Rectangle}, which is in device
     * space. If <code>onStroke</code> is false, this method Checks
     * whether or not the interior of the specified <code>Shape</code>
     * intersects the specified <code>Rectangle</code>.  If
     * <code>onStroke</code> is <code>true</code>, this method Checks
     * whether or not the <code>Stroke</code> of the specified
     * <code>Shape</code> outline intersects the specified
     * <code>Rectangle</code>.
     * The rendering attributes taken into account include the
     * <code>Clip</code>, <code>Transform</code>, and <code>Stroke</code>
     * attributes.
     * @param rect the area in device space to check for a hit
     * @param s the <code>Shape</code> to check for a hit
     * @param onStroke flag used to choose between Testing the
     * stroked or the Filled shape.  If the flag is <code>true</code>, the
     * <code>Stroke</code> oultine is Tested.  If the flag is
     * <code>false</code>, the Filled <code>Shape</code> is Tested.
     * @return <code>true</code> if there is a hit; <code>false</code>
     * otherwise.
     * @see #setStroke
     * @see #Fill(Shape)
     * @see #draw(Shape)
     * @see #_transform
     * @see #setTransform
     * @see #clip
     * @see #setClip(Shape)
     */
    public bool hit(Rectangle rect,
                       Shape s,
                       bool onStroke){
        if (onStroke) {
            s = GetStroke().CreateStrokedShape(s);
        }

        s = GetTransform().CreateTransformedShape(s);

        return s.intersects(rect);
    }
开发者ID:89sos98,项目名称:npoi,代码行数:40,代码来源:PPGraphics2D.cs


注:本文中的Shape.intersects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。