用这个程序,可以充满整个图片
procedure TForm1.Button1Click(Sender: TObject);
var
bmp1,bmp2:TBitmap;
begin
bmp1:=TBitmap.Create;
with Bmp1 do
begin
Width:= Canvas.TextWidth('ABC');
Height:= Canvas.TextHeight('ABC');
Canvas.TextOut(0,0,'ABC');
end;
bmp2:=TBitmap.Create;
with bmp2 do
begin
Width := 72;
Height := 14;
Canvas.CopyRect(Rect(0,0,72,14),bmp1.Canvas,Rect(0,0,Bmp1.Width,bmp1.Height));
SaveToFile('c:/123.bmp');
end;
bmp1.Free;
bmp2.Free;
end;