[英]Add a guide overlay to a flex video component (Mobile Camera).
我正在使用Flex中的移動應用程序讀取QRCode。 為了幫助用戶對齊代碼,我想在視頻面板的中央放置一個指南框。 我使用的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>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.