var
Bit:TBitMap;
begin
Bit:=TBitMap.Create;
Bit.Canvas.Handle:=GetWindowDc(0);
Bit.SaveToFile('D:\B.Bmp');
end怎么保存的图片是一个空图片啊。郁闷,请帮我解决
还有Bitblt这个函数是干什么的啊
TCanvas的pie是干什么的啊?
最好能举个例子
Bit:TBitMap;
begin
Bit:=TBitMap.Create;
Bit.Canvas.Handle:=GetWindowDc(0);
Bit.SaveToFile('D:\B.Bmp');
end怎么保存的图片是一个空图片啊。郁闷,请帮我解决
还有Bitblt这个函数是干什么的啊
TCanvas的pie是干什么的啊?
最好能举个例子
解决方案 »
- delphi做的窗体DLL,vc++调用,我的接口函数用什么数据类型好??
- 继承问题!
- hewei2003不好意思,我还有问题
- 找TreeView的应用事例.UP有分
- 怎样用sql做一个 交叉表???
- 请解释一下ADOQuery.next和ADOQuery.RecordSet.MoveNext的差别
- 分数不高希望各位鼎力相助,Delphi如何实现应用程序出现在任务栏右边和使机器扬声器发声?
- 请问用delphi怎样能把access倒入到oracle中,大家多帮忙!
- 为什么我的query的active属性不能设为true????
- Delphi园地又有新东西了...
- 怎样判断两次录音是不是同一个(比如都读字母A)
- 操作注册表添加 受信任的站点,为什么打开网址后,还是不好使??
var
DesktophWnd:hWnd;
DesktopDC:hWnd;
CursorhWnd:hWnd;
CurPos:Tpoint;
Rect:TRect;
Bitmap:TBitmap;
begin
DesktophWnd := GetDesktopWindow();
DesktopDC := GetDC(DesktophWnd);
GetWindowRect(DesktophWnd, Rect);
if IncludeCur then
begin
CursorhWnd:=GetCursor(); //捕获当前鼠标指针句柄
GetCursorPos(CurPos);
end; //获取当前鼠标指针的位置坐标
Bitmap := TBitmap.Create;//生成一个Tbitmap类型的实例对象
Bitmap.Width := Rect.Right-Rect.Left;
Bitmap.Height := Rect.Bottom-Rect.Top;
BitBlt(Bitmap.Canvas.Handle, 0, 0,
Bitmap.Width, Bitmap.Height, DesktopDC, 0, 0, SRCCOPY);//在抓取到的位图对象上绘制鼠标
if IncludeCur then
DrawIcon(Bitmap.Canvas.Handle, CurPos.X, CurPos.Y, CursorhWnd);
ReleaseDC(DesktophWnd, DesktopDC);
Bitmap.SaveToFile('C:\Desktop.bmp'); //使用类方法SaveToFile保存文件
Bitmap.Free;
ShowMessage('成功抓取屏幕并保存图像至C:\Desktop.bmp文件!');
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Button2.Enabled:=False;
if RadioButton1.Checked then
CopyCurrentDesktop(True)
else
CopyCurrentDesktop(False);
Button2.Enabled:=True;
end;