Compartilhar via


Media.imageSourceHeight

[O recurso associado a esta página, Reprodutor Multimídia do Windows SDK, é um recurso herdado. Foi substituído pelo MediaPlayer. O MediaPlayer foi otimizado para Windows 10 e Windows 11. A Microsoft recomenda fortemente que o novo código use o MediaPlayer em vez de Reprodutor Multimídia do Windows SDK, quando possível. A Microsoft sugere que o código existente que usa as APIs herdadas seja reescrito para usar as novas APIs, se possível.]

A propriedade ImageSourceHeight recupera a altura do item de mídia atual em pixels.

Sintaxe

player. currentMedia. imageSourceHeight

Valores possíveis

Essa propriedade é um Número somente leitura (long).

Comentários

Se o item de mídia não for o atual, essa propriedade retornará zero.

Para recuperar o valor dessa propriedade, o acesso de leitura à biblioteca é necessário. Para obter mais informações, consulte Acesso à biblioteca.

Exemplos

O exemplo JScript a seguir usa Media.imageSourceHeight para exibir o tamanho da imagem, em pixels, do item de mídia atual. As informações são impressas em um elemento TEXTAREA HTML chamado VideoSize. O objeto Player foi criado com 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 Valor
Versão
Reprodutor Multimídia do Windows versão 7.0 ou posterior.
DLL
Wmp.dll

Confira também

Objeto Media

Player.currentMedia

Settings.mediaAccessRights

Settings.requestMediaAccessRights