1

画像ビューでフラッシュ ビルダーを使用して Android および iPhone アプリを開発していますが、正常に動作している間、ピンチしてズームして Galaxy s3 または iPhone でアプリをテストするたびに、アスペクト比 (画像の高さと幅) を維持できません。ギャラクシーs2で。

私はこのコードを使用しています..

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        xmlns:com="com.*">
    <fx:Script>
        <![CDATA[
            [Embed(source="assets/image.jpg")]
            [Bindable]
            public var desertImage:Class;  


        ]]>
    </fx:Script>
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:titleContent>
        <s:Label color="#FFFFFF" fontWeight="bold" fontSize="25" text="Districts"/>
    </s:titleContent>

    <s:Group id="parentContaner"  width="100%" height="100%"  >
        <com:GestureImage x="1" y="2" width="{this.width}" height="{this.height}" source="{desertImage}" smooth="true" scaleMode="letterbox"    />

    </s:Group>


</s:View>

ピンチズーム機能としてジェスチャーイメージ..

    private function onGesturePinch(pinchEvent:TransformGestureEvent):void{
        setAsCurrentChild();  
        var pinchMatrix:Matrix = this.transform.matrix;  
        var pinchPoint:Point =  
            pinchMatrix.transformPoint(  
                new Point((this.width/2), (this.height/2)));  
        pinchMatrix.translate(-pinchPoint.x, -pinchPoint.y);  
        pinchMatrix.scale(pinchEvent.scaleX, pinchEvent.scaleY);  
        pinchMatrix.translate(pinchPoint.x, pinchPoint.y);  
        this.transform.matrix = pinchMatrix;  
    }
4

0 に答える 0