Delphi 调用一截图工具进行截图的方法《LceMeaning》

以下代码经本人在Delphi XE2下编写并通过。

procedure TForm5.img1Click(Sender: TObject);
var
 i : Integer;
begin
  try
    if img1.Picture.Graphic = nil  then
         begin
            if MessageBox(Handle, PChar(' 是否需要截图? 点击 ''''是(Y)'''' 后请等待1秒进入截图!                                         '),
                  PChar('截图工具'), MB_ICONINFORMATION or MB_YESNO or MB_DEFBUTTON1) = IDNO then
                 Exit;
            Hide;
            ICSystem.Form1.Hide;
            Sleep(700);
            i := WinExecAndWait32('PrintScreen.exe',True);
            ICSystem.Form1.Show;
            Show;
            if i = 0 then
              img1.Picture.LoadFromClipboardFormat(CF_BITMAP,ClipBoard.GetAsHandle(CF_BITMAP),0);
         end
    else
      begin
        with TForm6.Create(Application) do
          begin
            imgSimg.Picture.Graphic := img1.Picture.Graphic;
            ShowModal;
            if ModalResult = mrCancel then
              begin
                Free;
              end;
          end;
      end;
  except

  end;
end;

 

转载于:https://www.cnblogs.com/LceMeaning/p/3503316.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值