0
Im使用Flash Builder 4.5和AS3從實時JSON數據源動態加載圖像。它的加載和工作正常,並響應我的輕掃手勢(左滑動去回去,右刷卡前進到下一個圖像)...如何檢測圖像方向(人像與風景),然後再加載相應的旋轉階段?
我想添加一些動作來檢測其圖片的方向成功加載那麼如果其垂直方向的照片,把舞臺90度(並設置一些類型的標誌來記住其在「旋轉狀態」。
我怎樣才能做到這一點?
if (myPic && myPic.width > myPic.height)
{
// this picture is horizontal, so leave stage in normal landscape aspect ratio
} else {
// something here to take the stage and rotate it 90 degrees
}