New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win 10 scalling issue #297

Closed
MohammadHamdyGhanem opened this Issue Jan 5, 2019 · 9 comments

Comments

Projects
None yet
4 participants
@MohammadHamdyGhanem
Copy link

MohammadHamdyGhanem commented Jan 5, 2019

I used VASE app on win 10 ver 1803. It works fine, until I customized win 10 display setting to use a 125% or a 150% scale, when I noticed that subtitle text displayed on the video is shifted down so a part of it goes out of display.
This doesn't happen in Win 7 nor win 10 ver 17xx.
Note: VASE Uses Framework V: 4 . I had a performance issue with V 7.2 put this not our concern here!

What has changed, and how this can be solved in .NET? Or should this be solved in Win 10?

Note: This is the class that displays the subtitle text and measures its size:
https://github.com/MohammadHamdyGhanem/VASE/blob/master/src/Controls/TransparentRTFViewer.cs

and this is the class that control its pos on the vedio:
https://github.com/MohammadHamdyGhanem/VASE/blob/master/src/Controls/VideoPlayerContainer.cs
This is the part that does it:

void ResizeSubtitleTextBox(object sender, EventArgs e)
{
    if (ExitResizeTextBox || VideoWidth == 0)
        return;

    var _subtitlesHeight = _subtitleTextBox.Height;
    if (_subtitlesHeight == 0 || _panelcontrols == null)
        return;

    var p = PointToScreen(this.Location);
    _formSubtitle.Left = p.X + 2;

    float VideoHeight2 = (VideoHeight < VideoWidth) ? VideoHeight * Width / VideoWidth : Height;

    var h1 =  Height - (_subtitlesHeight + (_panelcontrols.Visible ? _controlsHeight : 0));
    var h2 =  PanelPlayer.Top + (int)((Height + VideoHeight2) / 2);
    _formSubtitle.Top = p.Y + Math.Min(h1, h2);
     _formSubtitle.Width = Width - 4;           
    _subtitleTextBox.Width = Width - 4;

    p = this.PointToScreen(_panelcontrols.Location);
    _formSubtitle.Height = Math.Max(_subtitlesHeight + 1, p.Y - _formSubtitle.Top - 2);
        }
@lextm

This comment has been minimized.

Copy link

lextm commented Jan 6, 2019

Quote from the Readme file,

This repo contains WinForms for .NET Core. It does not contain the .NET Framework variant of WinForms.

@MohammadHamdyGhanem

This comment has been minimized.

Copy link

MohammadHamdyGhanem commented Jan 6, 2019

@lextm :
I think this problem exists in .net core too, becuase the changes in win 10. So, any issue we report about .net framework win forms, is to be fixed in .net core version, which we will move to sooner or later. This is expected, becuase up and running apps today use .net framework, so practical issues come from them.

@lindexi

This comment has been minimized.

Copy link

lindexi commented Jan 6, 2019

@MohammadHamdyGhanem I am interested in your question. Can you bring your app to dotnet core to sure this problem exists in .net core too?

@merriemcgaw

This comment has been minimized.

Copy link
Member

merriemcgaw commented Jan 15, 2019

@MohammadHamdyGhanem please confirm it on Core for us to investigate.

@merriemcgaw merriemcgaw added needs-more-info bug and removed bug labels Jan 15, 2019

@merriemcgaw merriemcgaw added this to the Future milestone Jan 15, 2019

@MohammadHamdyGhanem

This comment has been minimized.

Copy link

MohammadHamdyGhanem commented Jan 15, 2019

@merriemcgaw
I updated win10 to v 1809 and retested the app, and it works fine now.
Thanks.

@MohammadHamdyGhanem

This comment has been minimized.

Copy link

MohammadHamdyGhanem commented Jan 15, 2019

I want to migrate the project to .NET Core 3.0 for more testing, put there is no such option in project properties, which shows only FW versions. How can I do this?

@MohammadHamdyGhanem

This comment has been minimized.

Copy link

MohammadHamdyGhanem commented Jan 15, 2019

VS.NET 2019 preview1 doesn't offer to create Win Forms app with .NET core . I installed .NET core 3.0 preview. Am I missing something here?

@lextm

This comment has been minimized.

Copy link

lextm commented Jan 16, 2019

@lindexi

This comment has been minimized.

Copy link

lindexi commented Jan 16, 2019

@lextm Do you mean using dotnet new winforms -o MyWinFormsApp to create a WinForms project and opening it in the VisualStudio 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment