These two functions are not common troubles, especially BLT (); they are not completely involved at the moment. This is an example of a preliminary attempt:
Code File:
Unit unit1; interfaceuses 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, temperature or temperature, DF, mysurface); dxdraw1.flip; freeandnil (mysurface); end; procedure temperature (Sender: tobject); var mysurface: tdirectdrawsurface; begin mysurface: = tdirectdrawsurface. create (dxdraw1.ddraw); mysurface. loadfromfile (imgpath1); dxdraw1.surface. loadfromfile (imgpath2); dxdraw1.surface. bltfast (0, 0, bounds (16, 4, trunc (mysurface. width * 0.9), trunc (mysurface. height * 0.9), ddbltfast_srccolorkey or ddbltfast_wait, mysurface); dxdraw1.flip; freeandnil (mysurface); end.