【发布时间】:2017-08-28 13:26:33
【问题描述】:
我正在尝试使用以下代码调整捕获的TCameraComponent 图像的大小:
procedure TForm1.GetImage;
begin
imagec.SampleBufferToBitmap(img.Bitmap, True);
with resizedimg.Bitmap do // Resize the image to another bitmap
begin
SetSize(300, 160);
if Canvas.BeginScene then
try
Canvas.DrawBitmap(img.Bitmap, TRectF.Create(0, 0, 300, 160), TRectF.Create(0, 0, 300, 160), 1.0);
finally
Canvas.EndScene;
end;
end;
end;
但是,每次我关闭相机并重新打开它时,调整大小的图像都会捕捉到实际TImage 的放大部分。为什么会发生这种行为?我做错了什么?
目标是调整 img.Bitmap 的大小以适应 300x160 像素。
【问题讨论】:
标签: delphi firemonkey delphi-10-seattle