Media.imageSourceHeight

[La funzionalità associata a questa pagina, Lettore multimediale Windows SDK, è una funzionalità legacy. È stata sostituita da MediaPlayer. MediaPlayer è stato ottimizzato per Windows 10 e Windows 11. Microsoft consiglia vivamente che il nuovo codice usi MediaPlayer anziché Lettore multimediale Windows SDK, quando possibile. Microsoft suggerisce che il codice esistente che usa le API legacy venga riscritto per usare le nuove API, se possibile.

La proprietà ImageSourceHeight recupera l'altezza dell'elemento multimediale corrente in pixel.

Sintassi

giocatore. currentMedia. imageSourceHeight

Valori possibili

Questa proprietà è un numero di sola lettura (long).

Commenti

Se l'elemento multimediale non è quello corrente, questa proprietà restituisce zero.

Per recuperare il valore di questa proprietà, è necessario accedere in lettura alla libreria. Per altre informazioni, vedere Accesso alla libreria.

Esempio

L'esempio JScript seguente usa Media.imageSourceHeight per visualizzare le dimensioni dell'immagine, in pixel, dell'elemento multimediale corrente. Le informazioni vengono stampate in un elemento TEXTAREA HTML denominato VideoSize. L'oggetto Player è stato creato 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>

Requisiti

Requisito Valore
Versione
Lettore multimediale Windows versione 7.0 o successiva.
DLL
Wmp.dll

Vedi anche

Oggetto Media

Player.currentMedia

Settings.mediaAccessRights

Settings.requestMediaAccessRights