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


C# Frame.Draw方法代码示例

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


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

示例1: RenderFrame

        protected void RenderFrame(Frame frame, bool acquireLock)
        {
            if (acquireLock)
                Monitor.Enter(UseResourceLock);

            try {
                // In D3D builds, this checks to see whether PIX is attached right now
                //  so that if it's not, we don't waste cpu time/gc pressure on trace messages
                Tracing.RenderTrace.BeforeFrame();

                if (frame != null) {
                    using (frame) {
                        _DeviceLost |= IsDeviceLost;

                        if (!_DeviceLost)
                            frame.Draw();
                    }
                }
            } finally {
                if (acquireLock)
                    Monitor.Exit(UseResourceLock);
            }

            _DeviceLost |= IsDeviceLost;
        }
开发者ID:pakoito,项目名称:Fracture,代码行数:25,代码来源:ThreadedRenderCoordinator.cs

示例2: pictureBox1_Paint

        /// <summary>
        /// Flushes the pictureBox and draws the _currentFrame
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void pictureBox1_Paint(object sender, PaintEventArgs e)
        {
            if(null == Globals.Simulator) return;

            //asks the Simulator to draw what it has

            //if (Globals.Simulator.State == SimulatorStateEnum.Initialised || Globals.Simulator.State == SimulatorStateEnum.Running) //
            //    _currentFrame = Globals.Simulator.DrawTurn((SimFrame)_currentFrame); //Update existing elements
            //else
                _currentFrame = Globals.Simulator.DrawTurn(new Vec2(pictureBox1.Width, pictureBox1.Height)); //draw elements

            //Draw the _currentFrame to the paintbox's Graphics
            _currentFrame.Draw(e.Graphics);

            //Set the background to that of the _currentFrame's
            pictureBox1.BackColor = _currentFrame.BackGround;
        }
开发者ID:anathem51254,项目名称:SCAssignment1,代码行数:22,代码来源:MainForm.cs


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