delphi 选择一张照片,让照片缩略图显示在图片控件中间  
官方Delphi 学习QQ群: 682628230(三千人)
频道

delphi 选择一张照片,让照片缩略图显示在图片控件中间


选择一张照片,让照片缩略图显示在图片控件中间。

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;


推荐分享
图文皆来源于网络,内容仅做公益性分享,版权归原作者所有,如有侵权请告知删除!
 

Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号

执行时间: 0.034008979797363 seconds