3

I am using axWindowsMediaPlayer and when I make the screen full, video is being shown but the player put 2 black block near side of video. I don't want these blocks.

I tried

 axWindowsMediaPlayer1.stretchToFit = true;

but that didn't work. Because my video is 800*600 and my screen 1920*1080, the problem might be. Any way to solve this problem programatically? I don't want to resize video.

Thanks in advance.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
dodotu
  • 117
  • 1
  • 5
  • 17
  • Take a look at my answer at: https://stackoverflow.com/questions/15749181/stretch-video-of-axwindowsmediaplayer-without-maintaining-aspect-ration-in-c-sha/55842239#55842239 – Simple Apr 25 '19 at 05:20

1 Answers1

1

AxWMPlayer does not support nonuniform stretching. So, you have to either: - make the WMPlayer of normal desired size, stretch uniformly (StretchToFit=true) and live with the black margins if they show up - make the WMPlayer oversized in Height or Width (so that it sticks out of the target space), stretch uniformly (StretchToFit=true). Due to the oversized WMPlayer, some of the video will be trucated (displayed outside of the space) but also the black margins will be truncated

Those two ways will mantain aspect ratio.

If you don't need aspect ratio kept, you may apply some ScalingTransform (WPF) or another similar effect to stretch the view afterwards. You will need to calculate coordinates properly, but the fact that WMP always centers the video and that you can read the video dimensions from IWMPMedia helps much.

quetzalcoatl
  • 32,194
  • 8
  • 68
  • 107