Select to view content in your preferred language

embed image

1037
4
Jump to solution
12-25-2012 02:51 PM
ArowanaIndah
Deactivated User
hi,
I have embed image into my popup. But how to make the image fit into whole white frame?
thank
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Yep, I guess I should have mentioned that...

In the commitProperties function you need to comment out part of the loop.

It is always best to remove unused and unwanted items instead of just make them invisible.
            override protected function commitProperties():void             {                 super.commitProperties();                  var attributes:Object = hostComponent.attributes;                 var formattedAttributes:Object = hostComponent.formattedAttributes;                 var mediaInfo:PopUpMediaInfo = hostComponent.activeMediaInfo;                  // hide all elements except the border inside the imageOrChartGroup                 for (var i:int = 0; i < imageOrChartGroup.numElements; i++)                 {                     var element:IVisualElement = imageOrChartGroup.getElementAt(i);                     //if (element !== borderRect)                     //{                     hideElement(element);                     //}                 }


You shoud also comment out this line as well:
/* Define the symbol fill items that should be colored by the "symbolColor" style.*/             //private static const symbols:Array = [ "borderRectSymbol" ];

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Arowana,

   The image border which comes from the PopUpMediaBrowserSkin is define to always be a square (i.e. the width == height). If your image has a width of 400 and a height to 370 than the border will be 400 x 400 and the image will not fill the square. Unless you want to screw with your images perspective than your best option is to remove the border from the PopUpMediaBrowserSkin. There are several posts concerning this if you search the forums.

http://forums.arcgis.com/threads/38375-Change-media-container-size-in-Pop-Up-Window?highlight=PopUpM...


Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow these steps as shown in the below graphic:

0 Kudos
ArowanaIndah
Deactivated User
hi robert, thank for the help.
I have copy PopUpMediaBrowser.mxml into com.esri.ags.skins.supportClasses
and remove :-
<s:Rect id="borderRect"
                    left="0" right="0" top="0" bottom="0">
                <s:stroke>
                    <s:SolidColorStroke id="borderRectSymbol"
                                        color="black"
                                        weight="1"/>
                </s:stroke>
</s:Rect>

and error appear. Did i do the wrong way?
Please kindly help me
0 Kudos
AnthonyGiles
Honored Contributor
Arowana, Robert,Sorry to jump in but I found that removing the s:Rect caused a number of other issues in areas that it is referenced, so I just placed an alpha tag with a zero which worked.RegardsAnthony
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Yep, I guess I should have mentioned that...

In the commitProperties function you need to comment out part of the loop.

It is always best to remove unused and unwanted items instead of just make them invisible.
            override protected function commitProperties():void             {                 super.commitProperties();                  var attributes:Object = hostComponent.attributes;                 var formattedAttributes:Object = hostComponent.formattedAttributes;                 var mediaInfo:PopUpMediaInfo = hostComponent.activeMediaInfo;                  // hide all elements except the border inside the imageOrChartGroup                 for (var i:int = 0; i < imageOrChartGroup.numElements; i++)                 {                     var element:IVisualElement = imageOrChartGroup.getElementAt(i);                     //if (element !== borderRect)                     //{                     hideElement(element);                     //}                 }


You shoud also comment out this line as well:
/* Define the symbol fill items that should be colored by the "symbolColor" style.*/             //private static const symbols:Array = [ "borderRectSymbol" ];
0 Kudos