本文整理自网络,侵删。
选择一张照片,让照片缩略图显示在图片控件中间。
procedure TForm1.TakePhotoFromLibraryAction1DidFinishTaking(Image: TBitmap);
begin
doDump(image,image1.Bitmap);
end;
procedure TForm1.doDump(tmpBmp:TBitmap; imgBmp:TBitmap);
var
w,h:integer;
begin
if tmpbmp.Width>tmpbmp.Height then
begin
h:=140;
w:=Ceil((140/tmpbmp.Height)*tmpbmp.Width);
end
else
begin
w:=140;
h:=Ceil((140/tmpbmp.Width)*tmpbmp.Height);
end;
imgbmp.Assign(tmpbmp.CreateThumbnail(w,h));
end;
相关阅读 >>
Delphi qr /条形码扫描仪应用示例代码(使用zxing,tframestand)
Delphi firedac压缩和修复ms access数据库
Delphi 从listview组件中的选定行在数据库中删除
Delphi2010中Delphi class explorer妙用
Delphi datasnap 的http 调用返回json
更多相关阅读请进入《Delphi》频道 >>