begin
GetWindowRect(ClientHandle, CR);
IR := imgMain.ClientRect;
NumRows := CR.Bottom div IR.Bottom;
NumCols := CR.Right div IR.Right;
with imgMain do
for Row :=0 to NumRows+1 do
for Col :=0 to NumCols+1 do
BitBlt(FDrawDC, Col*Picture.Width, Row*Picture.Height,
Picture.Width, Picture.Height,
Picture.Bitmap.Canvas.Handle, 0, 0, SRCCOPY);
end;