L
lxmzm
Unregistered / Unconfirmed
GUEST, unregistred user!
在用delphi5的MediaPlayer进行播放vcd文件,我想进行抓图(在暂停时),部分代码如下:
MediaPlayer1.Display:=panel1;
用bottom7进行抓图操作:
procedure Tmediaplay.Button7Click(Sender: TObject);
var MyBmp : TBitmap;
MyCanvas : Tcanvas;
dc : Hdc;
rect:TRect;
begin
try
myBmp := TBitMap.Create
MyCanvas := TCanvas.Create
rect := MediaPlayer1.DisplayRect
Dc := GetDc(Panel1.Handle);
myCanvas.Handle := dc;
myBmp.Width := rect.Right - rect.Left
myBmp.Height := rect.Bottom - rect.Top
myBmp.Canvas.CopyRect(rect,myCanvas,Rect);
myBmp.SaveToFile('temp.bmp');
finally
ReleaseDC(0 ,dc);
myBmp.Free;
myCanvas.Free;
end;
end;
但发现抓出的图,漆黑一片,不知何原因?跟颜色有关吗?(我的windows设置为800x600,16M颜色)
还有例如:
MCI_SETAUDIO=$873;
MCI_SETVIDEO=$0876 等,在mmsystem中好象没有,delphi的多媒体的帮助中也没有查到!哪才有呢?
MediaPlayer1.Display:=panel1;
用bottom7进行抓图操作:
procedure Tmediaplay.Button7Click(Sender: TObject);
var MyBmp : TBitmap;
MyCanvas : Tcanvas;
dc : Hdc;
rect:TRect;
begin
try
myBmp := TBitMap.Create
MyCanvas := TCanvas.Create
rect := MediaPlayer1.DisplayRect
Dc := GetDc(Panel1.Handle);
myCanvas.Handle := dc;
myBmp.Width := rect.Right - rect.Left
myBmp.Height := rect.Bottom - rect.Top
myBmp.Canvas.CopyRect(rect,myCanvas,Rect);
myBmp.SaveToFile('temp.bmp');
finally
ReleaseDC(0 ,dc);
myBmp.Free;
myCanvas.Free;
end;
end;
但发现抓出的图,漆黑一片,不知何原因?跟颜色有关吗?(我的windows设置为800x600,16M颜色)
还有例如:
MCI_SETAUDIO=$873;
MCI_SETVIDEO=$0876 等,在mmsystem中好象没有,delphi的多媒体的帮助中也没有查到!哪才有呢?