public void Generate(int frame, Action <ITexture> callback) { var sceneSize = sceneViewFrame.Size; var thumbSize = new Vector2(200); if (sceneSize.X > sceneSize.Y) { thumbSize.Y *= sceneSize.Y / sceneSize.X; } else { thumbSize.X *= sceneSize.X / sceneSize.Y; } var ap = new AnimationPositioner(); var savedTime = document.Animation.Time; var savedIsRunning = Document.Current.Animation.IsRunning; renderChain.Clear(); ap.SetAnimationFrame(document.Animation, frame, stopAnimations: true); sceneViewFrame.RenderChainBuilder?.AddToRenderChain(renderChain); renderList.Clear(); renderChain.GetRenderObjects(renderList); ap.SetAnimationTime(document.Animation, savedTime, stopAnimations: true); Document.Current.Animation.IsRunning = savedIsRunning; Window.Current.InvokeOnRendering(() => RenderThumbnail(callback)); }
public static void Render(this RenderChain renderChain) { if (renderObjects == null) { renderObjects = new RenderObjectList(); } try { renderChain.GetRenderObjects(renderObjects); renderObjects.Render(); } finally { renderObjects.Clear(); } }
public void SetRenderChain(RenderChain renderChain) { renderObjects.Clear(); renderChain.GetRenderObjects(renderObjects); }