Skip to content
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

Screen scaling / zoom / dpi calculations for proper rendering #59

Closed
huangli321456 opened this issue Aug 5, 2021 · 8 comments
Closed

Comments

@huangli321456
Copy link

huangli321456 commented Aug 5, 2021

wpf:Layout exception in Viewbox
<Window ...... Height="450" Width="800"> <Viewbox> <Grid Height="450" Width="800"> <fl:VideoView x:Name="flview"> <Grid> <Image Source="NoneCCTV.png"/> </Grid> </fl:VideoView> </Grid> </Viewbox> </Window>

@SuRGeoNix
Copy link
Owner

SuRGeoNix commented Aug 5, 2021

I don't see a Layout exception, I'm not familiar with viewbox at all. Can you provide more information and the exception message?

If you use the viewbox for the image then it should be inside VideoView and not outside.

image

@huangli321456
Copy link
Author

just like this,and run the application
image

@huangli321456
Copy link
Author

I have solved this problem. You can refer to my practice
WPF.zip

@SuRGeoNix
Copy link
Owner

OK I see your point. Those two files are based on libvlcsharp from here and here

So the issue is with DPI? If you feel confident I will review it and I will update this to the next version.

@huangli321456
Copy link
Author

those two files are here
image

not only DPI,the basic window size also affects the viewbox and indirectly the videoview
so you need to calculate the zoom ratio between the current screen and the design size of the base window
for example , your screen bound is 1920x1080,but base window size is design to 3840x2160,and system zoom layout is not 100% like this
image
under these circumstances,DPI and basic window size will all affect it

@SuRGeoNix
Copy link
Owner

This probably means that Renderer should also consider those factors. And I need also to ensure that doesn't brake anything else.

@SuRGeoNix SuRGeoNix changed the title wpf:Layout exception in Viewbox Screen scaling / zoom / dpi calculations for proper rendering Aug 5, 2021
@SuRGeoNix
Copy link
Owner

Hey, I tried to add this on v3.2 but the fix that you suggest didn't work for me. I didn't have time to do more research on this. I will have a look at the next update

@SuRGeoNix
Copy link
Owner

@huangli321456 I'm closing this as I cannot reproduce it anymore. Please re-open if you still have issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants