?? 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 + -