关于TMediaPlayer缩放,请您赐教
想使用现成的VCL TMediaPlayer 实现一个附属功能,但是它本身并不提供缩放功能,
其中DisplayRect似乎可以用来控制显示区域,但是我是用后无任何效果,以下通过状
态栏返回TRect的Height,Width值;
其中 Heitht=bottom-top ;
Width=right-left ;
从返回值看,即使指定TRect的坐标,也不能改变Height width值,不知道为什么,请
高手赐教
//()())))))))))))))))))))))))))))))))))))))))))))))))) Test TRect Area
Form1->StatusBar1->Panels->Items[0]->Text= IntToStr
(Form1->MediaPlayer1->DisplayRect.Width());
Form1->StatusBar1->Panels->Items[1]->Text= IntToStr
(Form1->MediaPlayer1->DisplayRect.Height());
//()()()()))))))))))))))))))))))))))))))))))))))))))))))
//————————————————————————————————————
Form1->MediaPlayer1->DisplayRect.left/*=Form1->Panel1->Left+*/ =0;
Form1->MediaPlayer1->DisplayRect.top/*=Form1->Panel1->Top+*/ =0;
Form1->MediaPlayer1->DisplayRect.right/*=Form1->Panel1->Top+*/ =50;
Form1->MediaPlayer1->DisplayRect.bottom/*=Form1->Panel1->Left+*/ =75;
struct TRect : public RECT
{
TRect() {}
TRect(const TPoint& TL, const TPoint& BR) { left=TL.x; top=TL.y;
right=BR.x; bottom=BR.y; }
TRect(int l, int t, int r, int b) { left=l; top=t;
right=r; bottom=b; }
TRect(RECT& r)
{
left = r.left;
top = r.top;
right = r.right;
bottom = r.bottom;
}
int Width () const { return right - left; }
int Height() const { return bottom - top ; }
bool operator ==(const TRect& rc) const
{
return left == rc.left && top==rc.top &&
right == rc.right && bottom==rc.bottom;
}
bool operator !=(const TRect& rc) const
{ return !(rc==*this); }
__property LONG Left = { read=left, write=left };
__property LONG Top = { read=top, write=top };
__property LONG Right = { read=right, write=right };
__property LONG Bottom = { read=bottom, write=bottom };
};
---------------------------------------------------------
本站提示:请您注册自己的用户标识(id)并登录使用您的News软件
设置方法可见: http://www.webking.com.cn 之"注册及登录说明"
在线帮助: http://www.webking.com.cn/chat
----本附加信息仅针对未登录用户,注册并登录后将自行移去----