本文整理汇总了C#中System.Windows.Media.Imaging.WriteableBitmap.FillRectangleFixed方法的典型用法代码示例。如果您正苦于以下问题:C# WriteableBitmap.FillRectangleFixed方法的具体用法?C# WriteableBitmap.FillRectangleFixed怎么用?C# WriteableBitmap.FillRectangleFixed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Imaging.WriteableBitmap
的用法示例。
在下文中一共展示了WriteableBitmap.FillRectangleFixed方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
public void Render(WriteableBitmap screen)
{
foreach (var asteroid in asteroids)
{
screen.FillRectangleFixed((int)asteroid.Position.X, (int)asteroid.Position.Y, (int)asteroid.Position.X + asteroid.Size, (int)asteroid.Position.Y + asteroid.Size, Palette.Asteroid);
}
}
示例2: Render
public void Render(WriteableBitmap screen)
{
foreach (var pellet in Pellets)
{
int left = (int)pellet.Position.X;
int right = (int)(pellet.Position.X + (PelletSize-1));
int top = (int)pellet.Position.Y;
int bottom = (int)(pellet.Position.Y + (PelletSize-1));
screen.FillRectangleFixed(left, top, right, bottom, EnergyColor);
}
}
示例3: Render
public void Render(List<Vector2> stars, Color color, int size, WriteableBitmap screen)
{
if (size <= 1)
{
foreach (var star in stars)
{
// TODO: Outside bounds of array error can occur here! Float accuracy adding up?
screen.SetPixel((int)star.X, (int)star.Y, color);
}
}
else
{
foreach (var star in stars)
{
screen.FillRectangleFixed((int)star.X, (int)star.Y, (int)star.X + size, (int)star.Y + size, color);
}
}
}
示例4: RenderPlayer
public void RenderPlayer(WriteableBitmap screen)
{
screen.FillRectangleFixed((int)X, Y, (int)X + (PlayerWidth-1), Y + (PlayerHeight-1), Palette.Player);
}
示例5: RenderEnergyBar
public void RenderEnergyBar(WriteableBitmap screen)
{
if (Energy > 0)
{
int y1 = EnergyBarBottom - (int)((Energy / EnergyMax) * (float)EnergyBarHeight);
if (Energy > 50.0f || barBlink)
{
screen.FillRectangleFixed(EnergyBarLeft, y1, EnergyBarRight, EnergyBarBottom, Palette.Energy1);
}
}
}