Share via


Media.imageSourceHeight

[La característica asociada a esta página, Reproductor multimedia de Windows SDK, es una característica heredada. Se ha reemplazado por MediaPlayer. MediaPlayer se ha optimizado para Windows 10 y Windows 11. Microsoft recomienda encarecidamente que el nuevo código use MediaPlayer en lugar de Reproductor multimedia de Windows SDK, siempre que sea posible. Microsoft sugiere que el código existente que usa las API heredadas se reescriba para usar las nuevas API si es posible.

La propiedad ImageSourceHeight recupera el alto del elemento multimedia actual en píxeles.

Sintaxis

jugador. currentMedia. imageSourceHeight

Valores posibles

Esta propiedad es un número de solo lectura (long).

Observaciones

Si el elemento multimedia no es el actual, esta propiedad devuelve cero.

Para recuperar el valor de esta propiedad, se requiere acceso de lectura a la biblioteca. Para obtener más información, consulte Acceso a la biblioteca.

Ejemplos

En el siguiente ejemplo de JScript se usa Media.imageSourceHeight para mostrar el tamaño de la imagen, en píxeles, del elemento multimedia actual. La información se imprime en un elemento TEXTAREA HTML denominado VideoSize. El objeto Player se creó con id. = "player".

<!-- Create an event handler to refresh the information when the current media changes. -->
<SCRIPT LANGUAGE = "JScript"  FOR = Player  EVENT = OpenStateChange(NewState)>

// Test whether the new media item is open.
if (NewState == 13){

   // Store the height and width of the new media item.
   var Height = Player.currentMedia.imageSourceHeight;
   var Width =  Player.currentMedia.imageSourceWidth;

   // Erase the information in the text area.
   VideoSize.value = "";

   // Test whether an image is visible.
   if (Height != 0 && Width != 0)

      // Display the image size information.
      VideoSize.value = Width + " x " + Height;
}
</SCRIPT>

Requisitos

Requisito Value
Versión
Reproductor multimedia de Windows versión 7.0 o posterior.
Archivo DLL
Wmp.dll

Consulte también

Media (objeto)

Player.currentMedia

Settings.mediaAccessRights

Settings.requestMediaAccessRights