📄 ddhelper.cs
字号:
using System;
using System.Drawing;
using Microsoft.DirectX.DirectDraw;
namespace DDGameHelper
{
/// <summary>
/// DirectDrawHelper 的摘要说明。
/// </summary>
public class DDHelper
{
/// <summary>
/// 在指定坐标上绘制一个 BmpRectCombo 的 第 frameidx 帧的图像
/// </summary>
public static void DrawBitmap(BmpRectCombo brc,int x,int y, int frameidx)
{
//小于0的情况,实际上需要输出部分位图,而非修正显示位置
if(x<0)x=0; if(y<0)y=0;
if (brc.BitmapObject.BitmapDisplayType == BitmapDisplayType.Transparent)
brc.DDHandleR.RenderSurface.DrawFast(x, y, brc.BitmapSurface , brc.RectangleArray.Rectangles[frameidx] ,
DrawFastFlags.SourceColorKey | DrawFastFlags.Wait);
else
brc.DDHandleR.RenderSurface.DrawFast(x, y, brc.BitmapSurface , brc.RectangleArray.Rectangles[frameidx] ,
DrawFastFlags.NoColorKey | DrawFastFlags.Wait);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -