If the picture is saved if the image is saved in the specified size.

xiaoxiao2021-03-06  53

The program is simpler and does not make other explanations.

Procedure TFORM1.BUTTON1CLICK (Sender: TOBJECT);

VAR

S: tbitmap;

RECT: TRECT;

RW, RH: Integer;

Begin

RW: = 400;

RH: = 300;

s: = tbitmap.create;

s.LoadFromfile ('c: /11.bmp'); // Original file

Rect.Left: = 0;

Rect.top:=0;

Rect.right: = rw;

Rect.bottom: = RH;

S.canvas.stretchDraw (RECT, S);

S.Width: = rw;

s.height: = rh;

S.SaveTofile ('c: /dd.bmp'); // Specify the size of the file after size

S.free;

END;

转载请注明原文地址:https://www.9cbs.com/read-55898.html

New Post(0)