How to combine several images of the same size in the timage-reply to the question "jxjljf"

Source: Internet
Author: User
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;

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.