These two functions may not be a general problem, especially BLT (); For the moment, this is an example of a preliminary attempt:
Code files:
Unit Unit1
Interface
uses
Windows, Messages, sysutils, variants, Classes, Graphics, Controls, Forms ,
Dialogs, Dxdraws, Stdctrls, DirectX;
Type
TForm1 = Class (Tform)
Dxdraw1:tdxdraw;
Button1:tbutton;
Button2:tbutton;
Procedure Button1Click (sender:tobject);
Procedure Button2click (sender:tobject);
End;
Var
Form1:tform1
Implementation
{$R *.DFM}
Const
ImgPath1 = ' C:\Temp\DelphiX.bmp ';
ImgPath2 = ' C:\Temp\Test.bmp ';
Procedure Tform1.button1click (sender:tobject);
var
mysurface:tdirectdrawsurface;
Df:tddbltfx;
Begin
Mysurface: = Tdirectdrawsurface.create (Dxdraw1.ddraw);
Mysurface.loadfromfile (IMGPATH1);
DXDraw1.Surface.LoadFromFile (ImgPath2);
Df.dwsize: = SizeOf (DF);
Df.dwddfx: = 0;
DXDraw1.Surface.Blt (Rect (0, 0, mysurface.width Div 2, Mysurface.height Div 2),
Mysurface.clientrect,
Ddblt_ Keysrc or ddblt_wait,
DF,
Mysurface;
Dxdraw1.flip
Freeandnil (mysurface);
End;
Procedure Tform1.button2click (sender:tobject);
var
mysurface:tdirectdrawsurface
Begin
Mysurface: = Tdirectdrawsurface.create (Dxdraw1.ddraw);
Mysurface.loadfromfile (IMGPATH1);
DXDraw1.Surface.LoadFromFile (ImgPath2);
DXDraw1.Surface.BltFast (0, 0,
Bounds (4, Trunc (Mysurface.width * 0.9), Trunc (Mysurface.height * 0.9)),
DD Bltfast_srccolorkey or ddbltfast_wait,
Mysurface);
Dxdraw1.flip;
Freeandnil (mysurface);
End;
End.