用BitBlt函数实现位图拷贝
//************************************************************
var
HDCScreen:HDC;
iWidth,iHeight:integer;
tmpRect:TRect;
begin
tmpRect := FormMovie.Panel1.ClientRect;
HDCScreen := GetDC(FormMovie.Panel1.Handle);
tmpBitmap :=TBitmap.Create;
iWidth := tmpRect.Right-tmpRect.Left;
iHeight := tmpRect.Bottom-tmpRect.Top;
tmpBitmap.Width := iWidth;
tmpBitmap.Height := iHeight;
iBitmapValide := True;
Bitblt(tmpBitmap.Canvas.Handle,0,0,iWidth,iHeight,
HDCScreen,tmpRect.Left,tmpRect.Top, SRCCOPY);
ReleaseDC(FormMovie.Panel1.Handle,HDCScreen);
//************************************************************
////
以下有省略
tmpJPEG := Tjpegimage.Create;
//创建JPEG
tmpJPEG.Assign(tmpBitmap);
//转换
tmpJPEG.CompressionQuality := 100;
tmpJPEG.Compress;
//采用JPEG压缩
try
tmpJPEG.Savetofile(SavePic.FileName);
//保存
finally
tmpJPEG.Free;
//释放JPEG
end;