如何截获桌面上的图案(100分)

  • 主题发起人 主题发起人 cool_cool
  • 开始时间 开始时间
C

cool_cool

Unregistered / Unconfirmed
GUEST, unregistred user!
我想通过鼠标选定区域,然后把选定区域的图案保存下来
 
这个比较难办,但反过来就容易了.<br>先把桌面保存下来,再选定区域.
 
怎么保存
 
procedure TForm1.Button1Click(Sender: TObject);<br>var<br>&nbsp; DC: HDC;<br>&nbsp; Canvas: TCanvas;<br>begin<br>&nbsp; DC:=GetDC(0);<br>&nbsp; try<br>&nbsp; &nbsp; Canvas:=TCanvas.Create;<br>&nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; Canvas.Handle:=DC;<br>&nbsp; &nbsp; &nbsp; Image1.Canvas.CopyRect(Rect(0, 0, Screen.Width, Screen.Height), Canvas, Rect(0, 0, Screen.Width, Screen.Height));<br>&nbsp; &nbsp; finally<br>&nbsp; &nbsp; &nbsp; Canvas.Free<br>&nbsp; &nbsp; end<br>&nbsp; finally<br>&nbsp; &nbsp; ReleaseDC(0, DC)<br>&nbsp; end<br>end;<br>
 
借花献佛啦,这是高先超大侠的作品,实在不很不错啊!附源码,完全满足你的要求。<br>http://kuga.51.net/download/files/snag.zip
 
能取mediaplay的图片吗,下载不了
 
mediaplay用的是DirectShow,用DC是截不了。
 
关注ing(^_^)<br>
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
1K
DelphiTeacher的专栏
D
后退
顶部