Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
WMP 11 sizing problem (Delphi 7)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jeff  
View profile  
 More options Jan 2 2008, 11:53 am
Newsgroups: borland.public.delphi.multimedia
From: Jeff <snafu1...@gmail.com>
Date: Wed, 2 Jan 2008 08:53:15 -0800 (PST)
Local: Wed, Jan 2 2008 11:53 am
Subject: WMP 11 sizing problem (Delphi 7)
Hi,

I'm migrating a D7 application to Vista that uses the windows media
player 6.4 activex control.  Since Vista no longer includes te 6.4
player (mplayer2.exe), the compatibility mode of version 11 is
automatically invoked.

In an open dialog component I created that includes the WMP control to
preview videos, the WMP control is resizing itself to the origianl
size of the  video and is not reflecting the width, height, or align
properties that I assign to the control.  My dialog component is
similar to the Delphi TOpenPictureDialog dialog in that the preview
area controls (including the WMP control) are added via code at
runtime.

Another unit in my project that uses a WMP control established in
design mode DOES correctly resize the video to fit within the WMP
control's bounds.

I've seen some older posts suggesting some possible work arounds
(i.e., IOleInPlaceObject.SetObjectRects, first setting the wmp's
parent to null, etc.) but nothing seems to work for me.  The WMP
control is always sized to fit the video's original size as if I
clicked the "Fit player to video on start" option within the actual
windows media player 11 application's video size menu.

I also tried importing the WMP11 activex control (WMPLib_TLB) and
using it, but encounterd the exact same behavior.

Does anyone have any suggestions on how I can get the WMP control to
correctly size itself via code and stretch the video to fit within the
sized WMP's bounds?

Thanks,
Jeff


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff  
View profile  
 More options Jan 8 2008, 9:23 am
Newsgroups: borland.public.delphi.multimedia
From: Jeff <snafu1...@gmail.com>
Date: Tue, 8 Jan 2008 06:23:22 -0800 (PST)
Local: Tues, Jan 8 2008 9:23 am
Subject: Re: WMP 11 sizing problem (Delphi 7)
One solution that I have discovered to my WMP video sizing issue is to
import the WMPLib_TLB, cast the 6.4 media player's OleObject, and then
set the player's UIMode property to "mini".   The code below is
included in the method that I use to create the 6.4 WMP.  If 6.4 isn't
installed (i.e. Vista), then the 6.4 media player object is cast to
the version 11 media player.

    // Cast the 6.4 Media Player to WMP11 and set uiMode.
    // This gets around the resizing issue with Vista and WMP 11.
    if IsWMP64Installed = False then  // Custom method to determine if
wmp version is 6.4
    begin
      with FMediaPlayer do
        (IDispatch(OleObject) as IWMPPlayer4).uiMode:='mini';
    end;

Using the above approach, the video is correctly sized to fit the wmp
object's bounds.  In my case the wmp object is located within a panel
and the wmp object's align property is set to alClient.

I still would be interested to learn if anyone knows of a way to
properly fit the video within a sized 6.4 wmp object without
explicitly casting it to IWMPPlayer4.

Thanks,
Jeff


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »