Problem Source: http://www.cnblogs.com/del/archive/2009/01/09/1373051.html#1743248
Procedure tform1.button1click (Sender: tobject); var bits: array [0 .. 5] of tbitmap; {suppose there are 6 images of the same size to be combined} I, n, x, y: integer; {n is used as the number of columns; X, Y is used as the position} begin n: = 3; {if there are 3 rows in each row; you can modify it at will} {read the image. The fake part is placed under c: \ temp, and name it 1.bmg1_2.bmp... 6.bmp} chdir ('C: \ temp \ '); for I: = 0 to length (BITs)-1 do begin bits [I]: = tbitmap. create; bits [I]. loadfromfile (inttostr (I + 1) + '.bmp '); end; {set the size of image1} If (n> length (BITs) or (n 0 then image1.height: = image1.height + bits [low (BITs)]. height; {drawing} X: = 0; Y: = 0; for I: = 0 to length (BITs)-1 do begin image1.canvas. draw (X, Y, BITs [I]); Inc (x, BITs [I]. width); If x> = image1.width then begin X: = 0; Inc (Y, BITs [I]. height); end; bits [I]. free; end;