vizca321 Lt


Registrado: 06 May 2008Mensajes: 83Ubicación: Mexico
|
Publicado: Vie 08 Dic, 2023 4:58 pm Asunto: TMediaPlayer Display |
|
|
Tengo el Código para ajustar el video a un panel de manera proporcional si funciona, pero parpadea demasiado
Dejo ejemplo de uso del codigo
declaramos las flotantes w y h publica y las cargamos después del open del MediaPlayer
| Código: |
MediaPlayer1->Display = Panel1;
MediaPlayer1->Wait = true;
MediaPlayer1->Open();
w = MediaPlayer1->DisplayRect.Right;
h = MediaPlayer1->DisplayRect.Bottom;
MediaPlayer1->Play();
|
| Código: |
void __fastcall TForm1::Panel1Resize(TObject *Sender)
{
TRect r;
if(w >= h){
r.right = Panel1->Width;
r.bottom = Panel1->Width / (w/h);
if(MediaPlayer1->DisplayRect.Bottom <= Panel1->Height && MediaPlayer1->DisplayRect.Right >= Panel1->Width ){
r.right = Panel1->Width;
r.bottom = Panel1->Width / (w/h);
}
if(MediaPlayer1->DisplayRect.Bottom >= Panel1->Height && MediaPlayer1->DisplayRect.Right <= Panel1->Width ){
r.right = Panel1->Height * (w/h);
r.bottom = (Panel1->Height);
}
}
else{
r.right = Panel1->Height * (w/h);
r.bottom = (Panel1->Height);
if(MediaPlayer1->DisplayRect.Bottom >= Panel1->Height && MediaPlayer1->DisplayRect.Right <= Panel1->Width ){
r.right = Panel1->Height * (w/h);
r.bottom = (Panel1->Height);
}
if(MediaPlayer1->DisplayRect.Bottom <= Panel1->Height && MediaPlayer1->DisplayRect.Right >= Panel1->Width ){
r.right = Panel1->Width;
r.bottom = Panel1->Width / (w/h);
}
}
r.top = (Panel1->Height/2) - (r.bottom / 2);
r.left = (Panel1->Width/2) - (r.right / 2);
MediaPlayer1->DisplayRect = r;
}
|
_________________ [code:1]//----------------Att Gabriel----------------
void Gracias(){
if (Respuesta == true){
Showmessage("Muchisimas Gracias!")
else
Showmessage("Ojala te sirva... ^_^ ");
}[/code:1] |
|