码迷,mamicode.com
首页 > 其他好文 > 详细

screen jpg

时间:2017-12-19 15:08:22      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:com   cep   pos   image   bmp   pat   can   begin   sig   

this is first code

 tom

//
procedure snapscreen(a,b,c,d:Integer);
var
  bmpscreen:Tbitmap;
  jpegscreen:Tjpegimage;
  FullscreenCanvas:TCanvas;
  dc:HDC;
  sourceRect, destRect: TRect;
begin
  try
  dc:=getdc(0);
  fullscreencanvas:=Tcanvas.Create;
  fullscreencanvas.Handle:=dc;
  bmpscreen:=Tbitmap.create;
  bmpscreen.Width :=c-a;
  bmpscreen.Height :=d-b;
  sourcerect:=rect(0,0,c-a ,d-b );
  destrect:= rect(a,b,c,d);
  bmpscreen.Canvas.CopyRect(sourcerect,fullscreenCanvas,destrect);
  jpegscreen:=Tjpegimage.Create ;
  jpegscreen.Assign (bmpscreen);
  jpegscreen.CompressionQuality:=100;
  jpegscreen.SaveToFile(ExtractFilePath(ParamStr(0))+formatdatetime(‘yyyymmddhhmmss‘,Now)+‘.jpg‘);
  FullscreenCanvas.Free;
  bmpscreen.Free;
  jpegscreen.Free ;
  ReleaseDC(0, DC);
  except
  end;
end;

screen jpg

标签:com   cep   pos   image   bmp   pat   can   begin   sig   

原文地址:http://www.cnblogs.com/alicent/p/8065050.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!