iPad VGA 连接器 - 在自己的应用程序中镜像屏幕?

发布于 2024-08-29 19:27:41 字数 38 浏览 6 评论 0原文

是否可以通过 VGA 连接器镜像屏幕?找不到任何有关此的信息。

Is it possible to mirror the Screen over the VGA Connector? Can't find anything about this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

没︽人懂的悲伤 2024-09-05 19:27:41

我一直在寻找和你一样的东西。上周末我写了一个小的 UIApplication 类别来添加镜像支持。我在 Google Code 上发布了代码。

http://code.google.com/p/iphoneos-screen-mirroring/

要使用它,您只需在应用程序委托的应用程序中进行设置即可完成启动。就像这样:

[[UIApplication sharedApplication] setupScreenMirroringOfMainWindow:mainWindow framesPerSecond:20];

上周末我只有一次机会在一台带有 Apple AV 输出线的大屏幕电视上尝试过。性能不是很好,因此我不建议使用高于 30 fps 的帧速率...

I was looking for the same thing you are. Last weekend I wrote a small UIApplication category to add mirroring support. I published to code on Google Code.

http://code.google.com/p/iphoneos-screen-mirroring/

To use it, you simply have to set it up in your application delegate's app did finish lauching. Like so:

[[UIApplication sharedApplication] setupScreenMirroringOfMainWindow:mainWindow framesPerSecond:20];

I only had one chance to try it out last weekend on a big screen TV with the Apple AV output cables. The performance is not stellar, thus I would not recommend using a frame rate higher than 30 fps...

时光礼记 2024-09-05 19:27:41

我认为值得补充的是 QuartzCore 框架是强制性的,否则你会在编译时出现 4 个错误。

Undefined symbols:
  "_CATransform3DMakeRotation", referenced from:
      -[UIApplication(ScreenMirroring) updateMirroredWindowTransformForInterfaceOrientation:] in UIApplication+ScreenMirroring.o
      -[UIApplication(ScreenMirroring) updateMirroredWindowTransformForInterfaceOrientation:] in UIApplication+ScreenMirroring.o
      -[UIApplication(ScreenMirroring) updateMirroredWindowTransformForInterfaceOrientation:] in UIApplication+ScreenMirroring.o
  "_kCAGravityResizeAspect", referenced from:
      _kCAGravityResizeAspect$non_lazy_ptr in UIApplication+ScreenMirroring.o
     (maybe you meant: _kCAGravityResizeAspect$non_lazy_ptr)
  "_OBJC_CLASS_$_CADisplayLink", referenced from:
      objc-class-ref-to-CADisplayLink in UIApplication+ScreenMirroring.o
  "_CATransform3DIdentity", referenced from:
      _CATransform3DIdentity$non_lazy_ptr in UIApplication+ScreenMirroring.o
     (maybe you meant: _CATransform3DIdentity$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status

I think it worth adding that the QuartzCore framework is mandatory, or you'll have 4 errors at compile time.

Undefined symbols:
  "_CATransform3DMakeRotation", referenced from:
      -[UIApplication(ScreenMirroring) updateMirroredWindowTransformForInterfaceOrientation:] in UIApplication+ScreenMirroring.o
      -[UIApplication(ScreenMirroring) updateMirroredWindowTransformForInterfaceOrientation:] in UIApplication+ScreenMirroring.o
      -[UIApplication(ScreenMirroring) updateMirroredWindowTransformForInterfaceOrientation:] in UIApplication+ScreenMirroring.o
  "_kCAGravityResizeAspect", referenced from:
      _kCAGravityResizeAspect$non_lazy_ptr in UIApplication+ScreenMirroring.o
     (maybe you meant: _kCAGravityResizeAspect$non_lazy_ptr)
  "_OBJC_CLASS_$_CADisplayLink", referenced from:
      objc-class-ref-to-CADisplayLink in UIApplication+ScreenMirroring.o
  "_CATransform3DIdentity", referenced from:
      _CATransform3DIdentity$non_lazy_ptr in UIApplication+ScreenMirroring.o
     (maybe you meant: _CATransform3DIdentity$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status
甜宝宝 2024-09-05 19:27:41

每个 UIWindow 对象(基本上是顶层视图)都分配有一个屏幕(UIScreen),您当然可以设置您想要的屏幕。因此,将主要内容移动到第二个屏幕很容易,但镜像很难。 (如果你不想听关于为什么它丑陋的讲座,请跳过直到下一段)我相信这是苹果的意图,既因为两次绘制相同的东西,一次具有更高的分辨率,也因为之前观看界面的体验与在视频播放、主题演讲开始等之前看不到任何内容相比,进入任何演示模式都是相当差劲的。这显然是您需要根据具体情况考虑的问题,但镜像仍然是一个坏主意。

UIWindow 继承自 UIView,因此尽管我对这件事没有太多个人经验,但您仍然应该能够将其绘制到某种位图上下文,然后使用两个不同的 UIWindows,每个 UIWindows 仅包含一个图像视图他们将实际像素推送到各自的屏幕上。如果您只想镜像一个特定的自定义视图(而不包括它的子视图),那么这会容易得多,因为您可以在设备屏幕上拥有该视图(以捕获任何输入),然后以您有一种方法的方式设计它调用以在其所处的任何上下文中绘制它(某些drawRect可能按原样工作正常),并从另一个屏幕上的超级特殊的很棒的自定义子视图进行调用,这将实现drawRect以仅调用实际视图上的方法。

希望这会有所帮助,抱歉我有点咆哮:(

Each UIWindow object (basically the top level view) is assigned a screen (UIScreen) and you can of course set the screen you want. Therefore moving the main content to a second screen is easy, but mirroring is hard. (If you don't want a lecture on why it's ugly skip until the next paragraph) I believe this is apple's intention, both because drawing the same thing twice, one with a MUCH higher resolution, and because the experience of watching the interface before entering whatever presentation mode is rather subpar in comparison to seeing nothing until the video is playing, keynote presentation has started, etc. This is something you obviously want to consider on a case by case basis, but nonetheless mirroring is a Bad Idea.

UIWindow inherits from UIView, so although I don't have much personal experience with this exact thing, you should still be able to get it to draw to a bitmap context of some kind, and then use two different UIWindows each with only an image view on a them pushing the actual pixels to their respective screens. This is considerably easier if you only want to mirror one specific custom view (and not including it's subviews) because you can have that view on the device screen, (to capture any input) and then design it in a way that you have a method to call to draw it in whatever context it's in (some drawRects might work fine as is) and the call that from a super special awesome custom subview on the other screen, which would implement drawRect to just call the method on the actual view.

Hope this helps, sorry I ranted a bit :(

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文