Image width bug?

http://pyroblue.dyndns.org:8080/flexapps/BhgPhotoContest/bin/BhgPhotoContest.html
if you view that page, you can see there is a lot of
whitespace underneath the image...im just setting the image width
(similar to what you do with HTML)...but for some reason, Flex puts
a bunch of whitespace (the original height's worth) at the bottom
of the image....
my mxml file looks like this:
<mx:HTTPService id="contestListing" url="photocontest.xml"
result="pcDataHandler(event)" fault="faultHandler(event)"/>

<mx:Repeater dataProvider="{photoContests}"
id="pcRepeater">

<mx:VBox>
<mx:Label
text="{photoContests.getItemAt(pcRepeater.currentIndex).pcName}"
fontSize="14" fontWeight="bold"/>

<mx:HBox>
<mx:Image
source="{photoContests.getItemAt(pcRepeater.currentIndex).prevPhoto}"
maxWidth="75" maintainAspectRatio="true"/>
<mx:Text
text="{photoContests.getItemAt(pcRepeater.currentIndex).desc}"
width="400" fontSize="10"/>
</mx:HBox>
</mx:VBox>
</mx:Repeater>
</mx:VBox>
any ideas?

Let's say your image is 300x300 pixels. You want to place it
into an area that is 100x200 and an area that's 500x200, centered
in both:
<mx:Image id="img1"
width="100" height="200" source="{imagefile}"
scaleContent="true" maintainAspectRatio="true"
horizontalAlign="center" verticalAlign="middle" />
<mx:Image id="img2"
width="500" height="200" source="{imagefile}"
scaleContent="true" maintainAspectRatio="true"
horizontalAlign="center" verticalAlign="middle" />
For img1, the smallest dimension is 100 (width) which it
matches to the real image's maximum dimension which is 300. That
means img1 will display an image 100x100 centered vertically with
50 pixels above and below.
For img2, the smallest dimension is 200 (height) which it
matches to the real image's maxium dimension which is 300. That
means img2 will display an image 200x200 centered horizontally with
150 pixels to the left and right.
The Image tag has 2 dimensions: img.width and img.height is
the area it occupies on the display. img.contentWidth and
img.contentHeight is area the pixels occupy. For img1, contentWidth
and contentHeight are 100, for example.

Similar Messages

  • Image Scaling Bug?

    I've been working with flex for a few weeks now, and I've
    come across this odd behavior in the Image class. The livedocs
    state that the default value for the scaleContent property of an
    Image object is 'true'. This is the case, and when setting the
    width or height of my image it scales correctly. The problem is
    that the container that holds the object only scales with the
    explicitly set value and leaves the other as its original size.
    The following code is a small testcase to show the behavior
    in action.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Style>
    .test {
    cornerRadius: 0;
    headerHeight: 0;
    borderThickness: 1;
    dropShadowEnabled: false;
    borderStyle: solid;
    backgroundColor: #333333;
    borderColor: #ff0000;
    titleStyleName: "myTitleStyle";
    </mx:Style>
    <mx:Box styleName="test">
    <mx:Image source="glassdoor.jpg" height="32"/>
    </mx:Box>
    </mx:Application>
    You'll have to replace the image name with one that you
    provide, and set the height to something smaller that the image's
    height to see the effect. The box's red border shows that it
    realizes the image is 32 pixels in height, but doesn't seem to know
    what to do with the implicitly scaled width. Any ideas? Am I doing
    something wrong, or is this a bug? Since the box normally conforms
    to the size of the object inside it, I would have expected it to
    shrink on both parameters to continue hugging the outside of my
    newly-scaled image.

    The problem is that when the Box asks the Image for its size
    it can only report the explicity set height. When the Image tag
    loads its source it scales it to make the size you set (32 high)
    but doesn't change its width - it is the Image and not the Box that
    is causing what you see. The Image won't shrink to fit the image
    loaded. Try adding horizontalAlign="center" to the Image and see if
    the loaded source floats in the middle.
    Using horizontalAlign and verticalAlign on the Image tag
    aligns the actual image within the Image tag space. For example, if
    you have <mx:Image width="100" height="100"
    horizontalAlign="center" verticalAlign="middle" /> and you load
    in a 300x600 image, the image will be scaled to 50x100 and be
    centered within the 100x100 area of the Image tag.
    In general, if you cannot give an explicit size, give a
    minWidth or minHeight, so the measurement phase of the Flex
    component layout cycle has something to work with.

  • Not able to get image width after uploading image

    hi
    I am working on uploading image. Once the image is uploaded I need to know image width and height. Right now I am listening to "complete" event but it seems image is still not loaded when the complete event is raised as it returns image width as zero. This is very urgent and imp for me, Please let me know how can I get the wridth and height of image once it is uploaded on remote server
    <mx:VBox width="100%" height="100%">
                <mx:Label text="Image" />
                <mx:HBox width="100%" height="10%">
                    <mx:TextInput id="txt_imgname" width="321"/>
                    <mx:Button label="Browse"  click="bn_Browse_Click()"/>
                </mx:HBox>
            <mx:Canvas width="400"  height="264" backgroundColor="#000000" borderStyle="solid" cornerRadius="12" borderThickness="3" borderColor="#222F92">
                <mx:ProgressBar id="progressBar"  indeterminate="true" visible="false" height="1%"  />
                <mx:Image id="img" complete="{imageLoadListener(event)}" />
            </mx:Canvas>
            <mx:HBox width="100%" height="10%" horizontalAlign="right" verticalAlign="middle">
                <mx:Button label="OK" id="okbutton" click="bn_ok_click()" />
                <mx:Button label="Cancel" click="bn_cancel_click()" />
            </mx:HBox>
    private function bn_Browse_Click():void
                CreateFileReference();
                 fileReference.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, onUploadCompleteData);
                 FileBrowse();
            private function FileBrowse():void
                try
                    var success:Boolean = fileReference.browse(allTypes);
                catch (error:Error)
                    Alert.show("Unable to browse for files.");
            private function CreateFileReference():void
                 var imageTypes:FileFilter = new FileFilter("Images (*.jpg, *.jpeg, *.gif, *.png)", "*.jpg; *.jpeg; *.gif; *.png");
                 allTypes = new Array(imageTypes);
                 fileReference = new FileReference();
                 fileReference.addEventListener(Event.SELECT, selectHandler);            
                 fileReference.addEventListener(ProgressEvent.PROGRESS, fileRef_progress);
             private function selectHandler(event:Event):void
                 var request:URLRequest = new URLRequest("http://"+TestLoginIntegration.GetServerAddress()+"/FileUpload/Default.aspx");
                try
                     request.contentType = "application/octet-stream";
                     request.method = "POST";
                   fileReference.upload(request,fileReference.name,false);  
                catch (error:Error)
                    Alert.show("Unable to upload file." + error.message);
             private function fileRef_progress(evt:ProgressEvent):void
                        img.source = "";
                    progressBar.visible = true;
            private function onUploadCompleteData (event : DataEvent) : void
                 var filePath:String = event.data;
                 img.source = filePath;
                 progressBar.visible = false;
                 txt_imgname.text = GetFileNameFromPath(filePath);
            private function imageLoadListener(e:Event):void{
               Alert.show(e.currentTarget.width);
    private function GetFileNameFromPath(filepath:String):String
                if(filepath == null || filepath == "")
                    return null;
                var name:String = filepath.substring(filepath.lastIndexOf("/") + 1, filepath.length);
                return name;

    Read this older post
    http://forums.adobe.com/message/1900768#1900768

  • Adjust image width and position along with browser size automatically.

    Hi,  I'm trying to place an image at the left edge of browser window, and the image width is 50% of the browser window size. The similar effect can be found on this website. Lenzing Instruments
    Notice that as the browser zoom out, the image remains half of the width of browser window and align with the right edge of the browser.
    I'm new to Muse. Not sure if it is possible to achieve this effect in Muse. I know Muse can set image 100% width of browser window, but how about 50%, 75% and other user defined proportion?
    Any help will be appreciated!

    Thank you for your reply Sanjit. Could you explain more in details about
    Exact responsiveness cannot be achieved but yes with scroll and pin you can create a similar effect
    I also followed this post Can you create responsive sites with Adobe Muse? It seems that Muse does not support responsive design very well. So I'm not sure how exactly to get an similar responsive design effect in Muse.
    Thanks!
    Yinze
    Design Engineer
    Lawson Hemphill Inc.

  • Controlling image width in XML brought into TextField via RSS

    Hello. First off, let me say that I am new to these forums,
    and new to AS 3.0
    Here's my question.
    I'm building an RSS Reader. Everything is working great,
    except I can't figure out how to control the size of images
    embedded in the XML of the blog posts.
    I attempted to set up a textField with an attached css
    stylesheet to limit image widths, but I couldn't get that to
    function. Should I try saving the remote XML to my server via PHP,
    and then adding my desired maximum width to every <img> tag?
    That seems like a lot of work for a simple task.
    Ideally, I'm dreaming of a textField or TextArea or
    ScrollPane property that would force contents to obey the
    container's width. Can you tell I usually write css?
    Thanks in advance for any advice.

    Assuming that html is valid xml, and it apparently is if you
    are working with it successfully, you would access that value like
    this:
    description.img.(@src)
    A labelFunction would make it easy to display that string.
    I haven't worked much with in-line renderers so ai am not
    sure you you would do it in there.
    Tracy

  • How can I get the image width and height stored in database?

    Hi!I write s servlet to display images store in database.but how can I get the image width and height?

    Have you tryed using PJA or a similar library?
    I presume you get java.lang.NoClassDefFoundError on the line :
    Toolkit.getDefaultToolkit();?

  • [CS2]How to get the Image Width & Height using JS (ILLUSTRATOR CS2)

    Hi,
    How to get the Image width & height of an Image using javascript .Im using Illustrator CS2.
    Any sample code
    Regards
    MyRiaz

    you can reference the dimensions of a loading image (or swf)
    by referencing the target movieclip's dimensions AFTER loading is
    complete. ie, use preloader code or the onLoadInit() method of a
    moviecliploader listener.

  • The crawled property of Image width and height - is there a differnce when the image is png format?

    Hi,
    We are indexing file share with images and get the properties of Image Width, Image Height, Image Size (we show it as refiners in SharePoint after make it managed properties). Somehow when the picture is png format - we see only Size but not height and width.
    Is that any setting that should be done in the file share (when i select an image in the windows explorer window i can see all its properties, and it seems that png files do expose the width and height properties
    keren tsur

    Hi  Keren,
    According to your description, my understanding is that when you tried to  crawl file share with images, the ows_ImageWidth and ows_ImageHeight crawled property for PNG  file could not be generated.
    For your issue, I can reproduce your issue in my SharePoint 2013 environment. For a workaround, you can upload the PNG images into SharePoint images Library and they would work fine.
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Image width

    Hello!
    I have an Image within a Canvas.
    Both of them have width set to 100%:
    - the Canvas has that so that it will stretch as much as it's own containter allows it.
    - the Image has both width and height set to 100% so that images larger than the Canvas are resized, otherwise a huge image is displayed and scroll bars for the Canvas.
    My question is, how can I get the Image width and height, not the container's but the real width and height of the displayed image? I need this because the Image container will always be as large as the Canvas.
    The idea is to superposition a canvas with text with the same width as the image, not the Image container, the image itself.
    Thank you!

    Not entirely what I wanted though now that I look more closely.
    It gives me the W and H of the image, not the resized image.
    The image is 1024x768 (for example) but resized to fit into a container... I wanted the size of the content displayed, not the size of the content loaded.

  • Safari image appearance bug

    Hi all,
    There is a image rendering bug when viewing images in this site:
    http://en.fotoalbum.eu/kodead/a595746/slideshow
    Try to change the images backwards. It appear when smaller image is displayed first and then when you change to bigger one the bigger image borders are displaced. The bug disappear when you click next (or changing from bigger to smaller image) or when you move over some object (ex. notepad window) over the wrong displayed image.
    I reported this bug in the safari, but there is no backlink or any number to track the issue, so I decided to write here - I want to check it regularly for solution.
    Thanks!
    PS and sory for my nickname. the system didn't accept shorter one several times

    If you'd like to track a bug, first register (for free) as an Apple Developer:
    http://developer.apple.com/programs/register/
    And then you'll be able to submit a report via the Apple Bug Reporter:
    http://developer.apple.com/bugreporter/
    ... which will allow you to track the bug.

  • Two different doubts that are one, perhaps - setting buttonMode? Getting loaded image width?

    Hi everybody,
    I'm quite a newbie using AS3 and as first pretentious learning project I'm creating a image multigallery.
    At this moment I have two questions (between several future others) relative to the code I'm writing (and suffering):
    How to correctly set the buttonMode in a dinamically created buttons?
    and
    How to get the width of the images that I'm dinamically loading? I'm planning to put them side by side, for this I need to know the width of each one.
    In the thread title I wrote that it can be just one doubt despite the totally different purposes of the codes. Maybe.
    Let me explain why: until now I could not understand completely the right way to direct the events inside dinamic functions.
    Here's my code until now:
    //// CREATE CONTAINERS ////
    // CREATE MENU CONTAINER //
    var menuContainer:MovieClip = new MovieClip();
    menuContainer.x=10;
    menuContainer.y=300;
    addChild(menuContainer);
    // CREATE IMAGES CONTAINER //
    var imagesContainer:MovieClip = new MovieClip();
    imagesContainer.x=100;
    imagesContainer.y=10;
    addChild(imagesContainer);
    // IMAGE LOADERS //
    var imagesLoader:Loader;
    var bigImagesLoader:Loader;
    //// LOAD XML ////
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, whenLoaded);
    xmlLoader.load(new URLRequest("XML/roiaXML.xml"));
    var xml:XML;
    function whenLoaded(evt:Event):void {
         xml=new XML(evt.target.data);
         var mySetsList:XMLList=xml.children();
         //// MENU BUTTONS ////
         // POSITIONING BUTTONS INSIDE MENU CONTAINER//
         var rowsQuantity:Number=3;
         var columnsQuantity:Number=Math.ceil(mySetsList.length()/rowsQuantity);
         var cellWidth:Number=160;
         // CREATE BUTTONS //
         for (var i:int=0; i< mySetsList.length(); i++) {
              var newSetButtonMC:setButtonMC=new setButtonMC();
              var imageNodesArray:Array = new Array();
              for (var j:int=0; j<mySetsList[i].IMAGE.length(); j++) {
                   imageNodesArray.push(mySetsList[i].IMAGE[j].attribute("smallURL"));
              newSetButtonMC.imageArray=imageNodesArray;
              newSetButtonMC.setButtonText.text=mySetsList.attribute("setTitle")[i];
              newSetButtonMC.setButtonText.autoSize=TextFieldAutoSize.LEFT;
              var cellX:Number=Math.floor(i/rowsQuantity);
              var cellY:Number=i%rowsQuantity;
              newSetButtonMC.x=cellX*cellWidth;
              newSetButtonMC.y=cellY*(newSetButtonMC.height+10);
              // I really don't know how to set the newSetButtonMC.buttonMode = true, nothing worked until now
              newSetButtonMC.addEventListener(MouseEvent.CLICK, onClickButton);
              menuContainer.addChild(newSetButtonMC);
         //// MENU BUTTONS ACTIONS ////
         function onClickButton(mevt:MouseEvent):void {
              // LOAD GALLERY IMAGES //
              var targetButton:setButtonMC=setButtonMC(mevt.currentTarget);
              for (i=0; i<targetButton.imageArray.length; i++) {
                   imagesLoader = new Loader();
                   imagesLoader.load(new URLRequest (targetButton.imageArray[i]));
                   imagesLoader.addEventListener(Event.INIT, getImageWidth);
                   imagesLoader.x=i*200;
                   imagesContainer.addChild(imagesLoader);
                   // LOAD BIG IMAGE WHEN CLICK IMAGE FROM GALERRY //
                   imagesLoader.addEventListener(MouseEvent.CLICK, loadBigImage);
              function getImageWidth(evtImageWidth:Event):void {// FUNCTION TO GET IMAGE WIDTH //
                   // I really don't know what to do here, i've tryed a lot
                   trace(evtImageWidth.target.width);
                   trace("ok");
         function loadBigImage(event:MouseEvent):void {
              trace("ok");
    I've tryed (and searched for solutions) a lot, maybe someone can help me.
    Thanks everybody . Abstrato

    Something new happened in my life, and it's called "contentLoaderInfo".
    <--- real happiness
    With this:
    imagesLoader.contentLoaderInfo.addEventListener(Event.INIT, getImageWidth);
    plus this:
    function getImageWidth(evt:Event):void {
    trace(evt.target.width);
    I was close to reach the supreme nirvana and I could trace the images widths.
    But there is a problem: i don't know what to do with the values to load each image side by side.
    Does someone know?
    Thanks . Abstrato

  • DNG Image Width/Length

    Nikon 5000 camera. I am converting nefs to dng. I am new to this whole area. I am trying to figure out why previews ina given software (IDImager) look different for the dng vs the nef. As an aside I am  looking at eh exif data. For the nef the data are:
    Image Width:160
    Image Length: 120
    For the DNG
    Image Width: 256
    Image Length: 170
    Why are they different? And does it matter since as I understand this only for how the RAW data are viewed in any preview and have no effect on the actual "raw" data.
    JD

    If you're talking about the JPEG preview image contained within the files, I think the DNG converter is simply creating a little bit larger preview image.  This does not have any impact on the raw data.

  • How to get blob image width with ordimage?

    Hello,
    I have trouble getting image width with ordimage. I have quite the same program for processing images as here: http://spendolini.blogspot.com/2005/10/manipulating-images-with-database.html
    so I have declared image files as BLOB files. How can I get the width for the them?
    There is a sample from ordimage reference:
    DECLARE
    image ORDSYS.ORDImage;
    width INTEGER;
    BEGIN
    SELECT p.product_photo INTO image FROM pm.online_media p
    WHERE p.product_id = 3515;
    -- Get the image width:
    width := image.getWidth();
    DBMS_OUTPUT.PUT_LINE('Width is ' || width);
    COMMIT;
    END;
    the ORDSYS.ORDIMAGE is used instead of BLOB here. when i do the same then i can't select BLOB content into the ORDSYS.ORDIMAGE variable. And otherwise I can't use the getWidth with the BLOB variable.
    Can anybody help please?

    Hi,
    the column blob_content is not suitable for storing into v_image2 because variable v_image2 is of type ORDSYS.ORDIMAGE and the column is BLOB.
    I used the following method instead:
    declare
    image blob;
    attributes clob;
    img_mimeType varchar2(32);
    img_width integer;
    img_height integer;
    img_contentLength integer;
    fileFormat varchar2(32);
    contentFormat varchar2(32);
    compressionFormat varchar2(32);
    begin
    DBMS_LOB.CREATETEMPORARY(attributes, TRUE, DBMS_LOB.CALL);
    select img
    into image
    from image_repository
    where id = 0;
    ORDSYS.ORDImage.getProperties(image,
    attributes,
    img_mimeType,
    img_width,
    img_height,
    fileFormat,
    compressionFormat,
    contentFormat,
    img_contentLength);
    dbms_output.put_line(img_mimeType);
    dbms_output.put_line(img_width);
    dbms_output.put_line(img_height);
    dbms_output.put_line(fileFormat);
    dbms_output.put_line(compressionFormat);
    dbms_output.put_line(contentFormat);
    dbms_output.put_line(img_contentLength);
    DBMS_LOB.FREETEMPORARY(attributes);
    end;
    try adapting this code and think about the possibility of "caching" image properties, because it takes some time to retrieve them every time.
    Bye,
    Flavio
    http://oraclequirks.blogspot.com/search/label/Apex

  • Global image width

    HI
    here's my problem:
    I can set a maximum image width glboally in contribute, so if
    a uer uploads a pic. the maximum width is let's say 600px. that's
    fine, but..
    can i put some code in my dreamweaver pages that page A has a
    maximum width of 600px and page B a maximum width of 700px?
    Love to hear from you!

    HI
    here's my problem:
    I can set a maximum image width glboally in contribute, so if
    a uer uploads a pic. the maximum width is let's say 600px. that's
    fine, but..
    can i put some code in my dreamweaver pages that page A has a
    maximum width of 600px and page B a maximum width of 700px?
    Love to hear from you!

  • Slideshow within composition widget - 100%width image causes bug

    Hi community,
    I asked once before for a solution. 
    Tried to solve it by myself, but everything I tried didn't change the problem and no one posted something similar.
    I placed a combination of a composition and a slideshow widget at my site because I want to have
    - triggers on which you can klick
    - 100% width images
    - the background images of the middle part of the site should change together with the slideshow image
    So I placed in every target of the composition widget a slideshow with only one image (set to 100% width) and the other elements.
    When I start the preview in the browser (Safari+Firefox), the images of the slideshow are set to 100% indeed, but the most times during the slideshow they are shifted to the right (always to the position where the other content starts),
    or - if I have a very small browser window - they are shifted to the left.
    In that moment I change the size of browser window a bit, they switch back to their 100%width look.
    Can anyone help me?
    Add some screenshotsr better understanding
    If I set the images not to 100%width it works well.
    Thanks
    nadine

    Did you find an answer to this?  If so, it would be great to see what you found.
    If not, I've come up with a workaround although it's not the best designed solution, but it works.
    First an explanation.  Although I didn't spend enough time researching Adobe Muse generated JavaScript for all the details, I found that the slideshow seems to correctly dynamically set its pixel width to a width that spans the browser window, however the css left property is not always dynamically adjusting properly and therefore shifts the image off of the screen. This appears to be something buggy or unintentional with the Adobe Muse generated code.
    So to solve this, the workaround is to keep triggering the window resize event so that the left property updates through the Adobe Muse generated script.  It would be better of course to trigger this only when the slideshow changes.  Or would even be better if the Adobe Muse team fixes the bug as well as makes it easier to create 100% width compositions so that the slideshow workaround is not even needed.
    In the meantime, here's how to implement the fix:
    1) In Adobe Muse, go to the page that your slideshow exists on
    2) Object > Insert HTML...
    3) Paste the below JavaScript
    <script>
    function triggerResize() {
    //trigger resize event
    if (document.createEvent) { // W3C
        var ev = document.createEvent('Event');
        ev.initEvent('resize', true, true);
        window.dispatchEvent(ev);
    } else { // IE
        document.fireEvent('onresize');
    //call the trigger evey 100 milliseconds
    setInterval(function () {triggerResize();}, 100);
    </script>

Maybe you are looking for

  • How to add a new field in the cube and load data

    Hi, The requirement is We have  ZLOGISTICS cube , the data souce of this filed has REFDCONR-reference dcument number filed . We have to create a new field in cube load data and get this new filed into the report also. Please any one can help me with

  • Error while importing roles in CmcApp

    Hi, I am setting up BO Edge and during the role import in CmcApp I get the following error: SAP_CMINIT3 : rc=20 > Connect to SAP gateway failed Connect_PM GWHOST=172.17.100.105, GWSERV=sapgw00, ASHOST=172.17.100.105, SYSNR=00 LOCATION CPIC (TCP/IP) o

  • Creating hyperlinks to pdf docs on a CD. Anyone experienced in doing this?

    Need to create hyperlinks to pdf documents in a CD. The pdf docs were created using an older version of Adobe and I am trying to follow a YOuTube instructing me how to create hyperlinks in the Table of Contents on the CD. The instructions on the YoTu

  • Problem Syncing Outlook Calendar: Error code - 0x80043ac9

    Hi, When I try to sync my Outlook 2003 calendar entries with my Curve, I get the following error: "Error encountered. Error code - 0x80043ac9. Check documentation." It seems to be stuck in the "Processing Device Calendar" screen, with "Record 20 of 8

  • Layer 7 class-map with different match types

    Hello, I am fighting with a problem on an ACE-4710 version A3(2.4) configuation. I just want to configure a layer 7 class-map that matches if one of two conditions is true. The problem is that these conditions are not from the same type and the ACE r