Well it comes down to a couple of things. Firstly, you haven't completely initialized your MapSurface. It needs a Width and Height. So

[pascal]
procedure TfrmTest.DXDrawInitialize(Sender: TObject);
begin
MapSurface := TDirectDrawSurface.Create(DXDraw.DDraw);
end;[/pascal]
should look like this

[pascal]
procedure TfrmTest.DXDrawInitialize(Sender: TObject);
begin
MapSurface := TDirectDrawSurface.Create(DXDraw.DDraw);
MapSurface.SetSize(DXDraw.Width,DXDraw.Height);
end;
[/pascal]
which will initialise your MapSurface to the same size as your DXDraw (Change the Width and Height values to whatever is appropriate if you don't want it so big).

The next problem is with the DrawPlayField procedure.
[pascal]
procedure DrawPlayfield;
begin
TileImageList.Items[i].Draw(MapSurface, XCoord, YCoord, 0);

DXDraw.Surface.Draw(0,0, MapSurface, false);
end; [/pascal] needs to become this...


[pascal]
procedure DrawPlayfield;
var
Src: TRect;
begin
Src.Left:=0;
Src.Top:=0;
Src.Right:=MapSurface.Width;
Src.Bottom:=MapSurface.Height;
DXImageList1.Items[i].Draw(MapSurface,XCoord,YCoord,0);
DXDraw.Surface.Draw(0,0,Src,MapSurface,True);
end;
[/pascal]

There are two versions of DXDraw.Surface.Draw and and while trying to get your code to work I found that the one you was using wasn't very effective without a Src RECT so I threw that in and along with the other adjustment seemed to work a treat. If you wish to only draw a part of the MapSurface then adjust the Src values accordingly. Hope this answers your question. Let us know how it goes or if you need me to explain myself better, I don't always make myself clear.


[EDIT : Few coding mishaps]