为伸缩视频组件(移动相机)添加一个指南覆盖



我正在flex中工作,读取QRCodes的移动应用程序。为了帮助用户对齐代码,我想在视频面板的中心放置一个引导框。我使用的PNG包含一个绿色矩形和透明的背景。我愿意接受所有的建议。下面显示了一切是如何工作的。

flash脚本外:

<s:VGroup width="100%" horizontalAlign="center" id="vg">
        <s:SpriteVisualElement id="sv" width="100%" height="250"/>
    </s:VGroup>

创建相机方法:

camera = Camera.getCamera();
camera.setMode(360, 360, 24);
videoDisplay.x = 360;
sv.addChild(videoDisplay);
videoDisplay.attachCamera(camera);
videoDisplay.rotation = 90;

如有任何提示,将不胜感激。我已经尝试了几件事,通常图像显示在相机视频窗口附近,而不是在它上面。

一些合适的组可以做到这一点…这样的:

    <s:Group width="100%" height="250">
        <s:SpriteVisualElement id="sv" width="100%" height="100%"/>
        <!-- nesting in another VGroup will allow you to center the image on the video -->
        <s:VGroup verticalAlign="middle" horizontalAlign="center" 
                  width="100%" height="100%">
            <!-- depending on size of the image, you might want to set scaling/maxWidth etc here -->
            <s:Image source="{yourImagePathOrClass}" />
        </s:VGroup>
    </s:Group>

最新更新