ddhelper.cs
来自「这是网上下载的很好的串口发短信的程序! 是用VC++来做的」· CS 代码 · 共 29 行
CS
29 行
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 + =
减小字号Ctrl + -
显示快捷键?