简体   繁体   English

如何在iPad 4:3的第二个屏幕16:9 airplay上制作16:9 pdf以适合vfr / Reader中的屏幕尺寸

[英]How to make 16:9 pdf to fit to screen size in vfr/Reader on second screen 16:9 airplay from iPad 4:3

I would like to display on the AirPlay screen the same content as the mainScreen like It does by default when you connect your device to AirPlay within the app. 我想在AirPlay屏幕上显示与mainScreen相同的内容,就像在应用程序中将设备连接到AirPlay时默认情况下那样。 This is OK work naturally. 这自然可以正常工作。

But my second screen is 16:9 and my iPad 4:3 and I use vfr/Reader and the pdf I read is in 16:9 What I want to achieve is like like PowerPoint when you launch a .pptx in slideshow mode. 但是我的第二个屏幕是16:9,我的iPad 4:3,我使用vfr / Reader,而我阅读的pdf是在16:9中。当您以幻灯片模式启动.pptx时,要实现的功能就像PowerPoint it show the pptx only in 16:9 on the second screen. 它仅在第二个屏幕上的16:9中显示pptx。

What i have tried is this : https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/WindowAndScreenGuide/UsingExternalDisplay/UsingExternalDisplay.html#//apple_ref/doc/uid/TP40012555-CH3-SW1 我试过的是这样的: https : //developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/WindowAndScreenGuide/UsingExternalDisplay/UsingExternalDisplay.html#//apple_ref/doc/uid/TP40012555-CH3-SW1

What i can achieve is to have the second screen bigger full width with red background : 我可以实现的是让第二个屏幕具有更大的全宽并带有红色背景:

   if (_secondWindow)
    {
        NSLog(@"INIT SECOND WINDOW");
        _secondWindow = [[UIWindow alloc] initWithFrame:screenBounds];
        _secondWindow.backgroundColor = [UIColor redColor];

        _secondWindow.screen = newScreen;
        _secondWindow.hidden = NO;

        //change size to 200 200 
        //_secondWindow.frame = CGRectMake(0, 0, 200,200);

        // Set the initial UI for the window.

    }

What i need is to say something like take the content of my main current widow and replicate it to the _secondWindow with different size bigger. 我需要说些类似的内容,例如将当前主要寡妇的内容复制到具有不同大小的_secondWindow中。

When i do this : 当我这样做时:

_secondWindow = [[[UIApplication sharedApplication] delegate] window];

I have the mainWindow content on the second screen but the size doesn't change. 我在第二个屏幕上有mainWindow内容,但是大小没有变化。 I only need to force the size of the mirroring screen, scale my content on the mirroring screen. 我只需要强制镜像屏幕的大小,在镜像屏幕上缩放内容即可。 and keep them sync 保持同步

Is there a way to achieve this ? 有没有办法实现这个目标? I see on some post that it is impossible to have the same instance for the two screens, is there maybe a better way than using the vfr/Reader something like have the reader in two webView or something else ? 我在某篇文章中看到,两个屏幕不可能有相同的实例,是否有比使用vfr / Reader更好的方法,例如在两个webView中放置阅读器或其他? Or the maximum that can be done in this situation is only replicate the current pdf as png (but keep high resolution quality) on the second screen ? 还是在这种情况下可以做到的最大结果就是在第二个屏幕上仅将当前的pdf复制为png(但保持高分辨率)?

But how it works when you have video in your app, you need to handle each cases? 但是,当您的应用中包含视频时,如何处理呢?

You need to create a whole new display using: 您需要使用以下方法创建一个全新的显示:

- (void)handleScreenDidDisconnectNotification:(NSNotification*)aNotification

and

- (void)handleScreenDidConnectNotification:(NSNotification*)aNotification

Then when you got that screen you can utilise the full resolution. 然后,当您看到该屏幕时,便可以使用完整分辨率。

In order to utilise the full with and height of the second screen (no borders) you need to: 为了利用第二个屏幕的全屏和高度(无边框),您需要:

secondScreen.overscanCompensation=UIScreenOverscanCompensationNone;

Where 'secondScreen' is the AirPlay: (UIScreen). 其中“ secondScreen”是AirPlay:(UIScreen)。

Observe that UIScreenOverscanCompensationNone was introduced in IOS 9, setting the overscanCompensation to 3 also works with older IOS versions however compatibility issues are unknown to me as I only target IOS 9 or later. 请注意,IOS 9中引入了UIScreenOverscanCompensationNone,将过扫描补偿设置为3也可以与较旧的IOS版本一起使用,但是我不知道兼容性问题,因为我仅针对IOS 9或更高版本。

/Anders /安德斯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM