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.

Similar Messages

  • JPEG Image Scaling Speed

    I've got an application where I'm drawing images to the display from a TCP/IP stream. I'm unable to acheive much better than 8 or 9 fps and the real CPU consuming task seems to be the JPEG image scaling. The frames are being scaled by about 2x but the same color depth is retained. I'm running this application on a dual, 1 Ghz PIII with Red Hat 7.1 and JDK 1.3.1. Any suggestions on how to enhance the performance of Java's image scaling would be appreciated.

    You could try using bufferedImages and doing the scaling yourself. I can re-draw a bufferedImage by altering it's raster data
    ie..
    byte [] data = bi.getData().getDataBuffer().getData();
    I get up to 100 fps edditing a 640x480 area. You will have to account for things like bit depth yourself, and scaling algo's, but it might be worth it.
    Also check the Bug database, I believe your problem MAY be related to a bug where scaling always converts the entire image to format -> RGBA -> scaled format.

  • Problems with image scaling

    I'm facing a real problem with image scaling
    I've used several algorithms but it all has defects but the most common thing is the out of memory error after several enlargments...
    does any one know a solution...
    note:
    I've used several packages to do so,but I'm looking for a solution from the jdk itself
    JAlexscorpio

    Did you take into account that the getScaledInstance() -method creates a completly new Image?
    So if you use it like in
    ImageIcon icon1=new ImageIcon("Blah.gif");
    ImageIcon icon2=new ImageIcon(icon1.getImage().getScaledInstance(400,400,SCALE_FAST);
    you will end up with 2 different Images which have their own data and memory requirements.
    even if you use something like
    ImageIcon icon1=new ImageIcon("Blah.gif");
    Image i=icon1.getImage();
    icon1.setImage(i.getScaledInstance(200,200,SCALE_FAST));
    You will need enough memory to store the data for the original image, as well as the data for the scaled
    version of the image, at least for the time that it take the JRE to create the scaled version. You never know when the garbage collector kicks in to delete you old data so it could be that this takes some time and until
    that moment your memory is not available. If your now doing several of the scaling operations, and there is no chance for the garbage collector to do its work, you will run out of memory.
    I hope that might help, if not feel free to post again

  • ComboBoxRenderer with image scaling

    hi all,
    I would like to know how to make the comboBoxRender with image scaling. Because my combo box is smaller than the image that I want to put inside..
    currently, I "extends JLabel implements ListCellRenderer", but if I call setIcon to the Label, it is not scale to the combo size..., so I think is it need to extends another type of component ?
    Could some of you give me a suggestion , better provide me a simple code.. Many Thanks for help.

    Hi,
    I've extended the Icon framework to support scaling. I never tried it with cell renderers, but maybe it works:
    Extend JXIconLabel, set the zoomingStrategy to FullZooming.RESPECTING_ASPECT_RATIO_INSTANCE and set the XIcon (eg. a XImageIcon).
    Maybe it works. (The library is open source.)
    http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JXIconLabel.html
    Homepage:
    http://www.softsmithy.org
    Download:
    http://sourceforge.net/project/showfiles.php?group_id=64833
    Source:
    http://sourceforge.net/svn/?group_id=64833
    http://softsmithy.svn.sourceforge.net/viewvc/softsmithy/trunk/lib/src/org/softsmithy/lib/
    API:
    http://softsmithy.sourceforge.net/lib/docs/api/index.html
    If you have questions just ask me!
    -Puce

  • Image Scaling Percentage

    I am converting from Quark 6.0 to Indesign CS3 and have a comparison question.
    When viewing an image within Quark you can get specifics about the images scaling percent ratio. IE: 100%, Reduced would be obviously 99.99% to 10% or enlarged would be obviously 100.1% to 150%.
    Is there anyway to see that kind of percentage in InDesign. We try to stay under 150% and above 10% for our printer specifications, so it will make things very difficult if we can not view that info like in Quark.
    Any help is greatly appreciated!!

    I guess what I was hoping for is for the % to actually give its configuration from the original 100% instead of saying that it 100% after it has been reduced or enlarged. Between the info and the % it more or less makes sense, but it is not exact and I guess the user has to somewhat guess? Seems like more work for the user.
    Thanks for your help!!

  • VI Method "Front Panel:Get Image Scaled" Memory Error 17

    Hi all, I've got two almost identical sub vi front panels that I'm dumping to a jpg image for reporting purposes.  One was copied and slightly modified from the other to show a different data set and plot.  The original works just fine, but the second sub vi, when using the "Front Panel:Get Image Scaled" method to pass the image to write the jpg, always returns the following error:
    "Error 17 occurred at Invoke Node in Myprogram
    Possible reason(s):
    LabVIEW:  Not enough memory to manipulate image.
    =============================
    NI-488:  Unrecognized command.
    Method Name: Front Panel:Get Image Scaled
    [Continue] [Stop]  "
    I've stripped the problem section into a simple tiny new that only opens the report and tries to get the image with the same working/non-working result above.  Using the Execution Trace Highlighter, it error is definitely occuring when the Method executes.
    Any ideas?  Thanks.

    Hey cjgpr,
        I haven't been able to dig up much info on this error message.  There's one other discussion forum post that talked about it some, and a KnowledgeBase article on it.  It seems that whatever changes you made to the front panel have caused it to exceed your computer's memory when creating an image.  Try removing items until it works, then see what actually breaks the functionality.
    Brian B
    Field Sales Engineer
    Tennessee/Southern Kentucky
    National Instruments

  • Image scaling changes

    Before I started here, the team was using FrameMaker 8 and migrating to FM 10. During the migration, we noticed that images in the documents we opened, converting them to FM10, had their image scaling data changed.
    Typically, we acquire screen shots using the highest resolution screen supported - mine is currently set at 1440 x 900. We scale the images to a width of 510 pixels (optimally) but no more than 600 pixels in our screen capture utility. We save the screen shots as Grayscale JPEGs. This process has, historically, provided images that fit our text column flow perfectly.
    In previous versions of FM, the images imported by reference appeared as 100% scaling in the FM image properties. Now, they appear as 75% scaling. We're wondering why and if there is any effects we need to be aware of in terms of PDF and HTML Help file sizes.
    While testing the import process, looking to see if the FM scaling data affected the image size, we saw that the pixel dimensions given by SnagIt varied wildly from the pixel dimensions given by FM. For example, the SnagIt dimensions for one image indicated it was 505x493 pixels whereas FM gave the dimensions of the source file as 507x315 pixels. Both are, as far as I know, giving me the source file dimensions but they are different.
    We might not have noticed this, the images looked okay, but we were carefully going through the transition to FM10 and looking at every detail.
    Question: why is FM10 auto-scaling the images to 75%?
    Question: does this scaling do anything to our output that we need to be aware of?
    Question: why do we get two different dimension data from the two software packages?
    Thanks,
    Wanda

    We  save the screen shots as Grayscale JPEGs.
    Are the screen images contone (e.g. real-world photos, CGI imagery),
    or flat (e.g. dialogs, line art)? JPEG uses curve-matching compression,
    which is great for tones that vary smoothly, but introduces nasty ringing
    edge artifacts on sharp edges of flat tones.
    TIF(zip), uses repeat-count compression, and is both non-destructive to flat
    tone images, and often compresses them more efficiently. We use EPS
    for the import format (no compression) and let Distiller or Acrobat post
    determine the compression to use.
    This process has,  historically, provided images that fit our text column
    flow perfectly.In  previous versions of FM, ...
    What is the target delivery format?
    ... the images imported by reference appeared as  100% scaling in
    the FM image properties. Now, they appear as 75%  scaling.
    In case you want to try it, I have never seen imported EPS objects
    change size when migrating a document to a later rev of FM.
    We import using 96 dpi.
    If the target is PC screen display at 100% page size, that's probably a
    decent target. PC screen resolutions today probably range from 80 to
    110 dpi, and I'd guess that 96 is very close to the sweet spot.
    We use (and I favor) bringing in all contone content at 200 dpi or
    higher. We bring bitmap (bi-level line art) in at 600. But then our
    target media is 600 dpi B&W bitmap on paper. However, we like
    to give web readers of the PDFs reasonable detail in images.
    Apple's "Retina" crusade is trying to move the industry to 300 dpi
    displays. I'd be happy with 200.

  • s:BitmapImage get image scaled size and position after it loaded and scaled

    I am try to know the dimensions of the uploaded image into <s:BitmapImage without success.
    The data coming back to me are isthe real image size and not size after it was scaled to fit the component size.
    I can see that the image scaled down and fit to the maxWidth, but I can't get the actual/real scaled width from the BitmapIMage properties.
    I tried:
    <s:BitmapImage id="mainBitMap"  ready="mainBitMap_readyHandler(event)" complete="bitmapimage1_completeHandler(event)" source="{data.Thumbnail.URL}" maxHeight="250" maxWidth="250" scaleMode="letterbox"/>
      protected function bitmapimage1_completeHandler(event:Event):void{ 
    trace("----------------------Start-----------------------"); 
    trace("mainBitMap.bitmapData.width" + mainBitMap.bitmapData.width); 
    trace("mainBitMap.width" + mainBitMap.width); 
    trace("mainBitMap.measuredWidth" + mainBitMap.measuredWidth); 
    trace("mainBitMap.displayObject.width" + mainBitMap.displayObject.width); 
    trace("mainBitMap.explicitWidth.width" + mainBitMap.explicitWidth); 
    trace("mainBitMap.preliminaryWidth" + mainBitMap.preliminaryWidth); 
    trace("mainBitMap.sourceWidth" + mainBitMap.sourceWidth); 
    trace("-----------------------End------------------------");
    Result:
    ----------------------Start-----------------------
    mainBitMap.bitmapData.width=435
    mainBitMap.width=0
    mainBitMap.measuredWidth=0
    mainBitMap.displayObject.width=0
    mainBitMap.explicitWidth.width=NaN
    mainBitMap.preliminaryWidth=NaN
    mainBitMap.displayObject.preliminaryWidth=435
    -----------------------End------------------------
    Thanks,
    Nimrod.

    Hi,
    I tried the ready event, But I still receive the same results.
    I expect to get the new scaled width And height according to the maxHeight and MaxWidth.
    I see that the image scaled to fi it But I can't recive the new size of it.
    Thanks,
    Nimrod

  • 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.

  • Error 53 : BD.Get Image Scaled

    Hi,
    I used invoke node(method block diagram:get image scaled) to get a screenshot of block diagram of a VI. It works well in LabView 8.6. But with the application built based on the VI, I got a 53 error code. Any suggestion?

    >>"Built" as in built into an .exe file?
    >>
    >>If
    so, you can't get an image of the block diagram because the block
    diagram is removed from the VI's when they are built into the
    executable.  The only thing present is any needed front panels, and the
    underlying compiled code that is built from the block diagram.
    >>
    >>For what reason do you want to capture an image of the block diagram?
    1. Yes, it is a .exx file.
    2. The application is used to generate screenshot of a user specified VI, not a VI built into the executable.

  • SHAKE: Image Scaling

    http://tech-algorithm.com/articles/trilinear-interpolation-image-scaling/
    I am trying to scale an image with the above mentioned technique but cannot seem to find the best way to combine the images at the end of the process.  Anybody have any ideas?

    http://tech-algorithm.com/articles/trilinear-interpolation-image-scaling/
    I am trying to scale an image with the above mentioned technique but cannot seem to find the best way to combine the images at the end of the process.  Anybody have any ideas?

  • Bug : Image Scaling and Centering

    I was wondering if this was a bug with flex or if I was doing something totally wrong.
    The amount of code in this is extremely low, so , I was guessing that there was nothing wrong from my part.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Image id="myimage" maintainAspectRatio="true"
    horizontalCenter="0" verticalCenter="0"
    source="@Embed(source='images.jpg')"
    scaleContent="true" width="100%" height="100%"/>
    </mx:Application>
    This is all the code there is in this application .
    My expectation from this code is that the image should fit the screen, maintain the aspect ratio of the image and finally be both centered horizontally and vertically!
    Can someone help me out in this ?

    Hi,
    Also set verticalAlign="middle" horizontalAlign="center" for the Image control

  • Strange problem with image scaling when placed

    I'm currently running InDesign CS6 from the Creative Cloud, and it's version 8.0. I have a PC and am running Windows 8.
    I am experiencing a really odd problem when placing images, and it only recently (within the last two weeks perhaps?) has developed. I do ebook production for a publisher. I have an InDesign template (INDD file really, but "blank" and ready to be filled in, and as such I refer to it as a "template") that I use, and the cover for the book goes on the first page. The document is set to pixels as the ruler measurement, and the pages are 650 pixels wide by 800 pixels tall. The margins are all set at zero. The cover images are sent to me as JPEGs and always have the same size: 72dpi setting and 500 pixels wide by 750 pixels tall. This is chosen to be about the size of the full screen on most ereaders, or close enough to be so.
    So when working on a new book, I put my cursor in the blank line that is set up to take the cover as an inline image. I do control-D to place, select the file, and hit enter. This SHOULD place an image at that location that is 500 pixels wide and 750 pixels tall when looking at the InDesign page rulers. Instead, InDesign insists on placing this image at 50% scaling, so that it is only 250 pixels wide by 375 pixels tall. And in the link info panel, it shows the actual PPI as 72 and the effective PPI as 144. It does this no matter how many preference changes I try (including the ones under file handling and the import setting options).
    The strangest part is that if the file is just a tiny bit different than 500x750 @72dpi, then there is no problem. For example, if I open the JPEG in Photoshop and change the image settings to 500x750 @73dpi, then InDesign places it at 100% scale like I want. If I change the image to 499x749 @72dpi it also gets placed in InDesign at 100% scaling. I've tried this with various new INDD documents with settings in pixels, inches, or picas as the ruler amounts, and with different page or margin sizes (just in case the problem is with my template). I get the same result no matter what.
    It appears that InDesign somehow thinks that any image that is exactly 500x750 @72dpi should be scaled at 50% when placing it into an InDesign file. Has anyone else run across this? Is it a bug or something I'm doing wrong? I've been doing this exact procedure for over a year, first with CS5 and now CS6, and I've never had this happen until just recently. I suppose it COULD be an accidental change in settings or preferences. But if it is, I cannot figure out how to change it back.
    UPDATE: I installed the 8.0.1 update and it did not resolve the issue. I also tried more image options. It looks like this scaling to 50% upon placing ONLY happens when all three attributes match this: 500x750@72dpi. All of the following modifications to the exact same image placed in the exact same spot in the exact same document resolved the issue:
    501x750@72dpi
    499x750@72dpi
    500x751@72dpi
    500x749@72dpi
    500x750@71dpi
    500x750@73dpi
    But of course, I don't want to have to modify every cover image I'm sent in order to prevent this scaling issue.

    I just tried this and got the same results (CS6, 8.0.1, on WinXP SP3). One other tidbit: the same 500px × 750 px @ 72ppi image saved as TIFF instead of JPEG worked correctly (at least for me). I haven't tried any other image formats yet.
    This sounds like a good candidate for an official bug report: http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    -Bill

  • Acrobat X problem with image scaling in Excel

    We are using Acrobat X standard with Excel 2007.
    The problem is that when using the Create PDF button on the Acrobat toolbar within Excel, if the document has been scaled using Page Layout-Scale option within Excel, the resulting PDF has the image the correct size, but it has not been scaled. So the dimensions are correct, but only half of the image will be visible.
    To see what I mean, in Excel, add a picture, then choose Page Layout-Scaling and set to e.g. 50%. Check the print preview to see how it should look, and make sure you have a real printer selected in File-Print (NOT Adobe PDF printer). Then create PDF using the toolbar button. The image in the PDF will be wrong.
    This works fine if using native PDF converter (e.g. Save As PDF file) or by printing to the PDF printer, or by using the CreatePDF button when the Adobe PDF printer is selected as default in the print options.
    This seems to be a bug in X as in 9 it worked fine.
    Is there a solution to this?
    Thanks

    I should add, I updated to 10.1 and it did not resolve the issue.

  • Scaling bug, Pro Res 422 codec

    So I've come across a rather unique bug, that has cropped up a few months back when our company switched over from Premiere Pro CC to Premiere Pro CC 2014. I suspect it has something to do with the new "set to frame size" feature, when you right click a clip within the timeline.
    When scaling footage in the effects panel, if the scale is not set to above 50.0,  the clip will display zoomed in in the program monitor on playback and also in the rendered video file after export. However, on pause, the clip will shows up at scale. Please see images below.
    Clip at playback:
    Same clip at pause:
    This seems to only happen with files round-tripped from our colour grading program. Relevant information about the files is below.
    •Apple Pro Res 422 Codec
    •.mov format
    •4k resolution (4096 * 2160)

    I'm having the same scaling issues with ProRes files. When I bring in the original R3D files, they scale down fine. I tried ProRes 422 HQ and ProRes 4444 and had the same issues. I was rendering out the ProRes files out of AE. No color correction done yet.
    Premiere Pro CC 2014.1
    OS X 10.9.4
    2 x 2.93 Ghz 6-Core Intel Xeon
    29 GB 1333 Mhz DDR3
    ATI Radeon HD 5770 1024 MB

Maybe you are looking for

  • Question about insert date value from xml file

    I want insert value into table from xml file. Every time I inserted value of date type into the table, I got the unpasable error message as following: oracle.xml.sql.OracleXMLSQLException: Exception 'java.text.ParseException:Unpars eable date: "2000-

  • Matrix Bad Value exception in ItemCode column

    hello , i faced an exception with filling itemcode column As u know this column is linked object and have CFL (choose from list) the problem i faced that on choosing from list i choose an item to add new line in matrix this event done and a new line

  • How to hilight a tab in level 1 or leve2 menus

    Hi , How to hilight a tab when we select that tab in leve1 or leve2 .Initially when ever the page loads 1 tab is hilighted and its not changing even though we select 2 nd tab. Jag

  • Dropped frames on capture

    FCP 4.5 last week all workflow was fine. yesterday (saturday) I could NOT even capture 1 minute of DV video without aborting after 20 seconds due to dropped frames. I wiped a drive clean thinking too much fragmentation. The only thing that changed is

  • Solution Manager to Solution Manager connection

    Hello everyone, I am searching for an answer for such a question: is it possible to connect one SolMan (the one from the service provider) to another SolMan (customer's one) in a way that tickets would go from customer's ERP to their SolMan (as it is