本文整理汇总了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;
}
示例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;
}