?? objfastblt.pas
字號:
unit ObjFastBlt;
//
//
// TDxFastBlt 用于處理32位真彩
// 真彩客戶端源碼QQ:442517066
//
//
interface
uses
Windows, Classes, SysUtils, Graphics, DxFastBlt, DirectDraw;
type
TDxFastBlt = class
private
FBitMap: TDXBitMap;
FPX, FPY: Integer;
function GetLeft: Integer;
function GetTop(): Integer;
procedure SetLeft(Value: Integer);
procedure SetTop(Value: Integer);
function GetWidth: Integer;
function GetHeight(): Integer;
procedure SetWidth(Value: Integer);
procedure SetHeight(Value: Integer);
function GetTransparentColor(): TColor;
procedure SetTransparentColor(Value: TColor);
function GetPitch: Integer;
function GetBits(): Pointer;
function GetPixel(X, Y: Integer): Cardinal;
procedure SetPixel(X, Y: Integer; const Value: Cardinal);
public
constructor Create();
destructor Destroy; override;
property BitMap: TDXBitMap read FBitMap;
property Left: Integer read GetLeft write SetLeft;
property Top: Integer read GetTop write SetTop;
property Width: Integer read GetWidth write SetWidth;
property Height: Integer read GetHeight write SetHeight;
property Pitch: Integer read GetPitch;
property PBits: Pointer read GetBits;
property TransparentColor: TColor read GetTransparentColor write SetTransparentColor;
property Pixels[X, Y: Integer]: Cardinal read GetPixel write SetPixel;
property PX: Integer read FPX write FPX;
property PY: Integer read FPY write FPY;
procedure Fill(Color: TColor);
procedure FrameRect(Rect: TRect; Color: TColor); overload;
procedure FrameRect(Left, Top, Width, Height: Integer; Color: TColor); overload;
procedure FrameRectAlpha(Rect: TRect; Color: TColor; Alpha: Byte);
procedure FillRect(Rect: TRect; Color: TColor); overload;
procedure FillRect(Left, Top, Width, Height: Integer; Color: TColor); overload;
procedure FillRectAlpha(Rect: TRect; Color: TColor; Alpha: Byte);
procedure Rectangle(Left, Top, Width, Height: Integer; ColorLine, ColorFill: TColor); overload;
procedure Rectangle(Rect: TRect; ColorLine, ColorFill: TColor); overload;
procedure RectangleAlpha(Left, Top, Width, Height: Integer; ColorLine, ColorFill: TColor); overload;
procedure RectangleAlpha(Rect: TRect; ColorLine, ColorFill: TColor); overload;
procedure RotateA(DxFastBlt: TDxFastBlt; X, Y, Angle: Integer; Scale: Real);
procedure RotateB(DxFastBlt: TDxFastBlt; X, Y, Angle: Integer; Scale: Real);
procedure RotateC(DxFastBlt: TDxFastBlt; X, Y, Angle: Integer; Scale: Real);
procedure RotateD(DxFastBlt: TDxFastBlt; X, Y, Angle: Integer; Scale: Real);
procedure RotateE(DxFastBlt: TDxFastBlt; X, Y, Angle: Integer; Scale: Real);
procedure RotateColorA(DxFastBlt: TDxFastBlt; X, Y, Angle: Integer; Scale: Real; Color: TColor);
procedure RotateColorB(DxFastBlt: TDxFastBlt; X, Y, Angle: Integer; Scale: Real; Color: TColor);
procedure RotateColorC(DxFastBlt: TDxFastBlt; X, Y, Angle: Integer; Scale: Real; Color: TColor);
procedure RotateColorD(DxFastBlt: TDxFastBlt; X, Y, Angle: Integer; Scale: Real; Color: TColor);
procedure RotateColorE(DxFastBlt: TDxFastBlt; X, Y, Angle: Integer; Scale: Real; Color: TColor);
procedure DrawA(DxFastBlt: TDxFastBlt; X, Y: Integer; Scale: Real);
procedure DrawB(DxFastBlt: TDxFastBlt; X, Y: Integer; Scale: Real);
procedure DrawC(DxFastBlt: TDxFastBlt; X, Y: Integer; Scale: Real);
procedure DrawD(DxFastBlt: TDxFastBlt; X, Y: Integer; Scale: Real);
procedure DrawE(DxFastBlt: TDxFastBlt; X, Y: Integer; Scale: Real);
procedure DrawRectA(DxFastBlt: TDxFastBlt; X, Y: Integer; Rect: TRect; Scale: Real);
procedure DrawRectB(DxFastBlt: TDxFastBlt; X, Y: Integer; Rect: TRect; Scale: Real);
procedure DrawRectC(DxFastBlt: TDxFastBlt; X, Y: Integer; Rect: TRect; Scale: Real);
procedure DrawRectD(DxFastBlt: TDxFastBlt; X, Y: Integer; Rect: TRect; Scale: Real);
procedure DrawRectE(DxFastBlt: TDxFastBlt; X, Y: Integer; Rect: TRect; Scale: Real);
procedure DrawAlpha(DxFastBlt: TDxFastBlt; X, Y: Integer; Alpha: Byte; Scale: Real);
procedure DrawRectAlpha(DxFastBlt: TDxFastBlt; X, Y: Integer; Rect: TRect; Scale: Real; Alpha: Byte);
procedure DrawColorA(DxFastBlt: TDxFastBlt; X, Y: Integer; Color: TColor; Scale: Real);
procedure DrawColorB(DxFastBlt: TDxFastBlt; X, Y: Integer; Color: TColor; Scale: Real);
procedure DrawColorC(DxFastBlt: TDxFastBlt; X, Y: Integer; Color: TColor; Scale: Real);
procedure DrawColorD(DxFastBlt: TDxFastBlt; X, Y: Integer; Color: TColor; Scale: Real);
procedure DrawColorE(DxFastBlt: TDxFastBlt; X, Y: Integer; Color: TColor; Scale: Real);
procedure DrawColorAlpha(DxFastBlt: TDxFastBlt; X, Y: Integer; Color: TColor; Alpha: Byte; Scale: Real);
procedure DrawRectColorAlpha(DxFastBlt: TDxFastBlt; X, Y: Integer; Color: TColor; Rect: TRect; Alpha: Byte; Scale: Real);
procedure DrawColorRectA(DxFastBlt: TDxFastBlt; X, Y: Integer; Color: TColor; Rect: TRect; Scale: Real);
procedure DrawColorRectB(DxFastBlt: TDxFastBlt; X, Y: Integer; Color: TColor; Rect: TRect; Scale: Real);
procedure DrawColorRectC(DxFastBlt: TDxFastBlt; X, Y: Integer; Color: TColor; Rect: TRect; Scale: Real);
procedure DrawColorRectD(DxFastBlt: TDxFastBlt; X, Y: Integer; Color: TColor; Rect: TRect; Scale: Real);
procedure DrawColorRectE(DxFastBlt: TDxFastBlt; X, Y: Integer; Color: TColor; Rect: TRect; Scale: Real);
procedure DrawOnSurface(Surface: TDDSurfaceDesc; DownToUp: Boolean); overload;
procedure DrawOnSurface(Surface: TDDSurfaceDesc2; DownToUp: Boolean); overload;
procedure LoadFromFile(const FileName: string);
procedure SaveToFile(const FileName: string);
end;
implementation
constructor TDxFastBlt.Create();
begin
FBitMap := TDxFastBlt_Create;
end;
destructor TDxFastBlt.Destroy;
begin
TDxFastBlt_Destroy(FBitMap);
end;
function TDxFastBlt.GetLeft: Integer;
begin
Result := TDxFastBlt_Left(BitMap)^;
end;
function TDxFastBlt.GetTop(): Integer;
begin
Result := TDxFastBlt_Top(BitMap)^;
end;
procedure TDxFastBlt.SetLeft(Value: Integer);
begin
TDxFastBlt_Left(BitMap)^ := Value;
end;
procedure TDxFastBlt.SetTop(Value: Integer);
begin
TDxFastBlt_Top(BitMap)^ := Value;
end;
function TDxFastBlt.GetWidth: Integer;
begin
Result := TDxFastBlt_GetWidth(BitMap);
end;
function TDxFastBlt.GetHeight(): Integer;
begin
Result := TDxFastBlt_GetHeight(BitMap);
end;
procedure TDxFastBlt.SetWidth(Value: Integer);
begin
TDxFastBlt_SetWidth(BitMap, Value);
end;
procedure TDxFastBlt.SetHeight(Value: Integer);
begin
TDxFastBlt_SetHeight(BitMap, Value);
end;
function TDxFastBlt.GetTransparentColor(): TColor;
begin
Result := TDxFastBlt_GetTransparentColor(BitMap);
end;
procedure TDxFastBlt.SetTransparentColor(Value: TColor);
begin
TDxFastBlt_SetTransparentColor(BitMap, Value);
end;
function TDxFastBlt.GetPitch: Integer;
begin
Result := TDxFastBlt_Pitch(BitMap);
end;
function TDxFastBlt.GetBits(): Pointer;
begin
Result := TDxFastBlt_GetPBits(BitMap);
end;
function TDxFastBlt.GetPixel(X, Y: Integer): Cardinal;
begin
Result := TDxFastBlt_GetPixels(BitMap, X, Y);
end;
procedure TDxFastBlt.SetPixel(X, Y: Integer; const Value: Cardinal);
begin
TDxFastBlt_SetPixels(BitMap, X, Y, Value);
end;
procedure TDxFastBlt.LoadFromFile(const FileName: string);
begin
TDxFastBlt_LoadFromFile(BitMap, PChar(FileName));
end;
procedure TDxFastBlt.SaveToFile(const FileName: string);
begin
TDxFastBlt_SaveToFile(BitMap, PChar(FileName));
end;
procedure TDxFastBlt.Fill(Color: TColor);
begin
TDxFastBlt_Fill(BitMap, Color);
end;
procedure TDxFastBlt.FrameRect(Rect: TRect; Color: TColor);
begin
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -