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


C# Timeline.GetTrackAreaBounds方法代码示例

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


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

示例1: RectangleToTrackExtents

        /// <summary>
        ///   Calculate the bounding rectangle in screen-space that would hold a track of the same extents as the given rectangle.
        /// </summary>
        /// <param name="rect">A rectangle which left and right edge represent the start and end of a track item. The top and bottom edge are ignored.</param>
        /// <param name="timeline">The timeline the assumed track would live on. Used to determine the top and bottom edge of the bounding rectangle.</param>
        /// <param name="assumedTrackIndex">The assumed index of the track. Used to determine the top edge of the bounding rectangle.</param>
        /// <returns>A bounding rectangle that would hold a track of the same extents as the given rectangle.</returns>
        internal static RectangleF RectangleToTrackExtents( RectangleF rect, Timeline timeline, int assumedTrackIndex )
        {
            Rectangle trackAreaBounds = timeline.GetTrackAreaBounds();

              int actualRowHeight = (int)( ( timeline.TrackHeight ) * timeline.RenderingScale.Y + timeline.TrackSpacing );
              // Calculate the Y offset for the track.
              int trackOffsetY = (int)( trackAreaBounds.Y + ( actualRowHeight * assumedTrackIndex ) + timeline.RenderingOffset.Y );

              // Calculate the X offset for track.
              int trackOffsetX = (int)( trackAreaBounds.X + ( rect.X * timeline.RenderingScale.X ) + timeline.RenderingOffset.X );

              // The extent of the track, including the border
              RectangleF trackExtent = new RectangleF( trackOffsetX, trackOffsetY, rect.Width * timeline.RenderingScale.X, timeline.TrackHeight * timeline.RenderingScale.Y );
              return trackExtent;
        }
开发者ID:Kagamia,项目名称:TimeBeam,代码行数:22,代码来源:BoundsHelper.cs


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