2012-12-21 18 views
0

我正在研究讀取QRCodes的flex中的移動應用程序。爲了幫助用戶對齊代碼,我想要在視頻面板的中心放置一個引導框。我正在使用包含綠色矩形和透明背景的PNG。我接受所有建議。以下顯示了一切工作。添加指南覆蓋到一個Flex視頻組件(移動照相機)。

閃光腳本之外:

<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; 

任何指針將不勝感激。我已經嘗試了幾件事情,並且通常圖像顯示在攝像機視頻窗口附近而不是其上。

+0

如果你所畫的覆蓋作爲在視頻播放全屏圖像,並設置alpha混合的疊加的東西v低? – ethrbunny

回答

1

幾個很好的放置組將做到這一點...這樣的:

<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> 
+0

謝謝你做到了! –