private void AddOverlay(TimelineElement shot, CompositeManifestInfo compositeManifestInfo)
        {
            var overlayAsset = shot.Asset as OverlayAsset;

            if (overlayAsset != null)
            {
                var dict = new Dictionary <string, object>();
                overlayAsset.Metadata.ForEach(mf => dict.Add(mf.Name, mf.Value));

                const double Timescale = 10000000.0;

                compositeManifestInfo.AddOverlay(
                    overlayAsset.Title,
                    overlayAsset.PositionX,
                    overlayAsset.PositionY,
                    overlayAsset.Height,
                    overlayAsset.Width,
                    dict,
                    overlayAsset.XamlResource,
                    (ulong)(shot.Position.TotalSeconds * Timescale),
                    (ulong)((shot.Position.TotalSeconds + shot.Duration.TotalSeconds) * Timescale));
            }
        }
コード例 #2
0
        private void AddOverlay(Shot shot, CompositeManifestInfo compositeManifestInfo)
        {
            var overlayItem = shot.Source as OverlayItem;

            if (overlayItem != null)
            {
                var dict = new Dictionary <string, object>();
                overlayItem.Metadata.ForEach(mf => dict.Add(mf.Name, mf.Value));

                const double Timescale = 10000000.0;

                compositeManifestInfo.AddOverlay(
                    overlayItem.Title,
                    overlayItem.X,
                    overlayItem.Y,
                    overlayItem.Height,
                    overlayItem.Width,
                    dict,
                    overlayItem.XamlTemplate,
                    (ulong)((shot.SourceAnchor.MarkIn + shot.TrackAnchor.MarkIn) * Timescale),
                    (ulong)(((shot.SourceAnchor.MarkIn + shot.TrackAnchor.MarkIn) + (shot.SourceAnchor.MarkOut - shot.SourceAnchor.MarkIn)) * Timescale));
            }
        }