First of all, I want to thank everyone involved in this project, the ones who made MediaPortal the best HTPC program by far and it is still evolving.
I have been following these forums for more than 7 months now, but I have never posted a message here so far, so here’s my first post.
I am using MediaPortal mainly for its TV features and I always felt it was missing some screen ratios. I can only use “Normal†or “Zoomâ€. “Normal†maximizes the height of the 4:3 image on my 16:9 screen and leaves two thick black bars each side, while “Zoom†maximizes the width of the image, but crops too much from the upper and lower part of the image, so the subtitles and logo don’t show anymore. “Stretch†alters the aspect ratio too much. There are also some shows, mainly on the Discovery and Viasat channels which are transmitted in 14:9 aspect ratio and “Normal†would yield an image with black bars at all sides, while “Zoom†will magnify too much and subtitles won’t be shown.
Something in between “Normal†and “Zoom†was definitely needed, so I decided to do something myself about this, because I’ve seen several topics about this, without any outcome. I also know that devs are busy fixing bugs, rather than bringing in any new functionality.
So I’ve downloaded the sources and I’ve added a new screen ratio called “Zoom to 14:9â€, which is a perfect trade off to watch 12:9 (4:3) shows on a 16:9 screen, because the black bars at the sides are half the width they were with “Normal†and the amount of image cropped from top and bottom is non essential, the logo and the subtitles still fit nicely on the screen. Also the 14:9 shows will no longer have black bars at top and bottom. This new screen ratio can also be used to enlarge the 2.35:1 movies on a 16:9 screen, so the black bars at top and bottom will be half-size.
Here’s the code that handles the image conversion in Core\guilib\Geometry.cs
Remember that I'm not a programmer, so if you think that the code can be further optimised, please feel free to suggest any modifications.
Here's a patch file for TortoiseSVN which will modify all the 19 files needed for this to work: LINK (right-click and choose "save target as" to download).
Of course this modification can be further developed. The code which handles the conversion can be reused to add even more ratios beside 14:9 (1.55:1), like 13:9 (1.44:1) and 15:9 (1.66:1) and maybe assign a new key which toggles the ratios in zoom mode to 13, 14, 15, 16:9.
If there are enough people that like this modification and find it useful, maybe it will find it's way, some day, into the SVN. I am now using "Zoom to 14:9" as the default screen ratio when watching TV.
I have been following these forums for more than 7 months now, but I have never posted a message here so far, so here’s my first post.
I am using MediaPortal mainly for its TV features and I always felt it was missing some screen ratios. I can only use “Normal†or “Zoomâ€. “Normal†maximizes the height of the 4:3 image on my 16:9 screen and leaves two thick black bars each side, while “Zoom†maximizes the width of the image, but crops too much from the upper and lower part of the image, so the subtitles and logo don’t show anymore. “Stretch†alters the aspect ratio too much. There are also some shows, mainly on the Discovery and Viasat channels which are transmitted in 14:9 aspect ratio and “Normal†would yield an image with black bars at all sides, while “Zoom†will magnify too much and subtitles won’t be shown.
Something in between “Normal†and “Zoom†was definitely needed, so I decided to do something myself about this, because I’ve seen several topics about this, without any outcome. I also know that devs are busy fixing bugs, rather than bringing in any new functionality.
So I’ve downloaded the sources and I’ve added a new screen ratio called “Zoom to 14:9â€, which is a perfect trade off to watch 12:9 (4:3) shows on a 16:9 screen, because the black bars at the sides are half the width they were with “Normal†and the amount of image cropped from top and bottom is non essential, the logo and the subtitles still fit nicely on the screen. Also the 14:9 shows will no longer have black bars at top and bottom. This new screen ratio can also be used to enlarge the 2.35:1 movies on a 16:9 screen, so the black bars at top and bottom will be half-size.
Here’s the code that handles the image conversion in Core\guilib\Geometry.cs
Code:
case Type.Zoom149:
{
// fit the image to screen size
float fNewWidth = (float)ScreenWidth;
float fNewHeight = (float)(fNewWidth / fOutputFrameRatio);
if (fNewHeight > ScreenHeight)
{
fNewHeight = ScreenHeight;
fNewWidth = fNewHeight * fOutputFrameRatio;
}
float iPosX = 0;
float iPosY = 0;
float fVertBorder = 0;
float fHorzBorder = 0;
float fFactor = fNewWidth / ((float)ImageWidth);
// increase the image size by 12.5% and crop or pad if needed
fNewHeight = fNewHeight * 1.125f;
fNewWidth = fNewHeight * fOutputFrameRatio;
if ((int)fNewHeight < ScreenHeight)
{
fHorzBorder = (fNewWidth - (float)ScreenWidth) / 2.0f;
fHorzBorder = fHorzBorder / fFactor;
iPosY = (ScreenHeight - fNewHeight) / 2;
}
if ((int)fNewWidth <ScreenWidth> ScreenWidth && (int)fNewHeight > ScreenHeight)
{
fHorzBorder = (fNewWidth - (float)ScreenWidth) / 2.0f;
fHorzBorder = fHorzBorder / fFactor;
fVertBorder = (fNewHeight - (float)ScreenHeight) / 2.0f;
fVertBorder = fVertBorder / fFactor;
}
rSource = new System.Drawing.Rectangle((int)fHorzBorder,
(int)fVertBorder,
(int)((float)ImageWidth - 2.0f * fHorzBorder),
(int)((float)ImageHeight - 2.0f * fVertBorder));
rDest = new System.Drawing.Rectangle((int)iPosX, (int)iPosY, (int)(fNewWidth - (2.0f * fHorzBorder * fFactor) + 0.5f), (int)(fNewHeight - (2.0f * fVertBorder * fFactor) + 0.5f));
}
break;
Here's a patch file for TortoiseSVN which will modify all the 19 files needed for this to work: LINK (right-click and choose "save target as" to download).
Of course this modification can be further developed. The code which handles the conversion can be reused to add even more ratios beside 14:9 (1.55:1), like 13:9 (1.44:1) and 15:9 (1.66:1) and maybe assign a new key which toggles the ratios in zoom mode to 13, 14, 15, 16:9.
If there are enough people that like this modification and find it useful, maybe it will find it's way, some day, into the SVN. I am now using "Zoom to 14:9" as the default screen ratio when watching TV.