Scripting TGetProperty width and height

Hello all,
i have a problem with the flash player in IE6 and FF2.
I have a html page with some flash movie elements on it.
I'm using SWFObject to bind the movies in.
After the onload event is fired, for each flash movie the
javascript function setCorrectSize4Flash will be called to resize
the html container element (embed, object tag) automatically by the
given width and height of the flash movie.
Therefore i'm checking if the movie is completely loaded and
if width and height is not undefined.
So if i'm getting width and height, i'm resizing the
container element to best fit in.
My problem is now, that the same movie used several times in
the same html page has every time different width and height
values. Sometimes the aspect ratio is 1:2 and sometimes it's 2:1.
Is this a problem of the flash player plugin or am i doing
something wrong.
Best regards,
bartmark

Thank you for your answer. But I don't understand:
The question is not the margin. I put in the body margin: 0; padding:0; and there is no margin.
I want to know the viewport:   the width and height with the iPad in horizontal position and without the address bar.
This does not coincide with the 1024 x 768. (nor the 946 x 768 if I rest the address bar).  I don't understand why
Thank you
Narcís

Similar Messages

  • How to create a map that is larger than the game in width and height?

    hi,
    i wounder how i can create a map(not the design) that is larger than the game in width and height, part of it will appear in the main page and anther part you can move to it after you press the arrow symbol, but the map is just one image so i want put it in line and out line the game page, and the out line part includes buttons and symbols the player can use, but it will be in line and the other part will be out line when you press the left arrow or the down arrow, how i can do that?
    and is that possible to animate it so when the player press the arrow, will give it action to start the animation in one sec, i know how to animate it if that possible but i don't know which code i will use for the mouse click with the arrow symbol, and how to use the same code in the same symbol to start anther animation depending on which part of the map is on?

    I don't know a lot about mask and masked layers and how to work with the normal layers beside i will use some 3D graphics but not in the background, i will explain all this to you to be more clearly.
    first i am using action script 3.0
    close ex,
    you have 2d map"image"  900*300 pixel.
    this image contains some 2d symbols when you click will go to anther normal map (anther normal layer) so they must appear.
    your game 320*320 px, and the place the map will show on 300*300, and there's basics objects will be in most pages including the page that show the map so i don't know a lot about how this will work with mask layers.
    so you can only see the left side of the map image and what it contains, while there's two arrows one to the left and one to the right there's three cases here,
    first when it show the left side(start from x:0 to x:300), the left arrow will not active when you press and the right arrow will start an animation that make the map image move to the mid side in one sec when you press.
    in mid side (start from x:301 to x:600) the same left arrow will active when you press to send you back to the left side while the same right arrow will be active to send you not to the mid side but to the right side,
    when moved to the right side the same left arrow will be active to send you to the mid and the right will not active when you press and depending on that,
    first how to make the large image appear with the three sides in the same place without effecting the other objects "like disappearing them" ?
    and the codes i need in the same left or right arrow symbol to make different actions with the same symbol when clicked depending on which part of the map is on.

  • Current page (not Document) width and height with JSX

    Hi,
    I am trying to create a script that saves every page of the document and add its width and height to the name.
    So far I managed to get the dimensions of the document using:
    app.activeDocument.pages.documentPreferences.pageWidth;
    app.activeDocument.pages.documentPreferences.pageHeight;
    That's ok when all the pages in the document have the same dimensions (Document Preferences).
    However, when I use custom pages that does not work.
    I tried the code below but does not work either.
    for(i=0; i<nb;i++)
         app.activeDocument.pages[i].documentPreferences.pageWidth;
         app.activeDocument.pages[i].documentPreferences.pageHeight;
    I have done some research and I don't seem to find any information regarding custom pages dimensions.
    Can you please help with this?
    Thanks in advance,
    Isko

    Main();
    function Main() {
        var doc = app.activeDocument,
        pages = doc.pages,
        page, width, height;
        for (var i = 0; i < pages.length; i++) {
            page = pages[i];
            width = page.bounds[3] - page.bounds[1];
            height = page.bounds[2] - page.bounds[0];
            $.writeln("Page: " + page.name + " - " + "width = " + width + ", height = " + height);

  • Flex 4 Premium reference to the Stage issue! width and height seem to be switched??

    So I am doing a very basic resize effect with a panel, but if I want it to fill the screen, I have to switch stage.stageWidth and stage.stageHeight. I have also traced them out and they come out as switched values. Anyone else having this issue?
    protected function panel1_addedToStageHandler(event:Event):void
          trace(stage.stageWidth, " " , stage.stageHeight);

    Hi,
    You maybe running into some sort of layout constraint also it depends on how you are initiating the animation, if you are doing it on startup you need to wait for creationComplete to ensure all your dimensions have been calculated for the browser. You shouldn't need to use stage dimensions either. The following code resizes a panel to fill the browser. (note using top/left/bottom/right is a lot smoother than width and height).
    David
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx"
       creationComplete="application1_creationCompleteHandler(event)">
    <fx:Script>
    <![CDATA[
    import mx.events.FlexEvent;
    protected function application1_creationCompleteHandler(event:FlexEvent):void
    pw.valueFrom=pnl.width;
    ph.valueFrom=pnl.height;
    fillscreen.play();
    ]]>
    </fx:Script>
    <fx:Declarations>
    <s:Animate id="fillscreen" target="{pnl}" repeatCount="1" duration="1000">
    <s:SimpleMotionPath id="pw" property="width" valueTo="{width}"/>
    <s:SimpleMotionPath id="ph" property="height" valueTo="{height}"/>
    </s:Animate>
    </fx:Declarations>
    <s:Panel id="pnl" width="250" height="200" horizontalCenter="0" verticalCenter="0">
    </s:Panel>
    </s:Application>

  • Fullscreen published in flash - htm 100%  width and height file is too big

    Hello everyone
    I need some help to create a fullcreen flash animation inside
    dreamweaver.
    What I did was to create a html file published in flash 100%
    width and height.
    It worked well on my explorer browser, but the size of the
    file is 995 k and this would be my index.
    When I publish on my provider the file doesn't open, probably
    is too big as an index, i don't know.
    Is there anyone there that could help me on that one?
    Thank you
    This is the code on Dreamweaver html
    <HTML>
    <HEAD>
    <meta http-equiv=Content-Type content="text/html;
    charset=ISO-8859-1">
    <TITLE>back_men</TITLE>
    </HEAD>
    <BODY bgcolor="#262626">
    <!-- URL's used in the movie-->
    <!-- text used in the movie-->
    11cf-96B8-444553540000"
    codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
    WIDTH="100%" HEIGHT="100%" id="back_men" ALIGN="">
    <PARAM NAME=movie
    VALUE="file:///C|/betoko_webfiles/flash_files/betoko/back_men.swf">
    <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor
    VALUE=#262626> <EMBED
    src="file:///C|/betoko_webfiles/flash_files/betoko/back_men.swf"
    quality=high bgcolor=#262626 WIDTH="100%" HEIGHT="100%"
    NAME="back_men" ALIGN=""
    TYPE="application/x-shockwave-flash" PLUGINSPAGE="
    http://www.macromedia.com/go/getflashplayer"></EMBED>
    </OBJECT>
    </BODY>
    </HTML>
    <script type="text/javascript"
    src="fixit.js"></script>

    Well, firstly you have > 60 minutes of video, therefore, you should not use the 60 minute preset. Since you have 80 minutes of video, you're probably better off using the 90 minute preset.
    Secondly, the presets assume that you are compressing your audio to AC3 with A.pack or Compressor 2 (depending on which version of DVDSP you're using). Uncompressed audio takes up lots of disc space and bandwidth.
    Thirdly, the difference between the measured size in the Finder and the size in DVDSP is the difference between true gigabytes (how the Finder measures things) and billions of bytes (how DVDSP measures things). When you Get Info in the Finder, look at the number following the file size in GB... it's a larger number that's so many billions of bytes. This larger number should agree with the number you see in DVDSP. See the DVD FAQ for a discussion of this issue.

  • Width and height of eps file

    Please let me know on how to get the width and height of an eps file.
    regards,
    Sashi

    Then you can read the properties from the list of file comments… (without opening in Illustrator) an example of the line would look like this…
    %%HiResBoundingBox: 19.8906 4.45117 262.1094 63.5488
    So read the file and use a regular expression to find this line… It is in 'points' but so is Illustrator scripting so you need calculate other measures if required…
    I have a ready made function for this but its at home… I will post later if you have no luck with this…

  • How to calculate actual selection or group width and height with clipping

    If a group has clipping paths then the height and visible bounds will include the dimensions of all paths selected including the clipped or hidden paths.
    However, the width and height shown on the width and height of the AI detail boxes for the selection shows just the visible dimensions.
    I want to retrieve the same values that is shown on the screen when a group is selected.
    It is somewhat counterintuitive that the "visiblebounds" property does not show just what is visible.
    I'm scaling the visible content of a selection to fit within another path but I need to be able to calculate the dimensions of the only what is visible after clipping.
    What do you have to do with scripting to get these values? Go through all of the path items in a group recursively and save the min and max values of any visiblebounds for clipping paths? Any better alternatives that I don't see?
    Thanks for any help!

    I ended up using the visible bounds for both scale and position as I also discovered that attempting to position a group with the position method would also result in missing the mark. The top and left (x,y) bounds I calculated without the clipped dimensions needed to be used to offset the actual position where I wanted the visible paths to be displayed.
    The functions I used ended up looking like so:
    function GetPoints(dblInch)
         var dpi = 72;
         return dblInch * dpi;
    function getRealVisibleBounds(grp) {
         var outerBounds = [];
         for(var i = grp.pageItems.length - 1; i >= 0;i--)  {
              var bounds = [];
              if(grp.pageItems[i].typename == 'GroupItem') {
                   bounds =  getRealVisibleBounds(grp.pageItems[i]);
              else if((grp.pageItems[i].typename == 'PathItem' || grp.pageItems[i].typename == 'CompoundPathItem')
                   && (grp.pageItems[i].clipping || !grp.clipped)) {
                   bounds = grp.pageItems[i].visibleBounds;
              if (bounds.length > 0) {
                   outerBounds = maxBounds(outerBounds,bounds);
         return (outerBounds.length == 0) ? null : outerBounds;
    function positionVisible(grp,x,y)
         var bounds = getRealVisibleBounds(grp);
         var newX = GetPoints(x) + (grp.left - bounds[0]);
         var newY = GetPoints(y) + (grp.top - bounds[1]);
         grp.position = [newX,newY];
    function maxBounds(ary1,ary2) {
         var res = [];
         if(ary1.length == 0)
              res = ary2;
         else if(ary2.length == 0)
              res = ary1;
         else {
              res[0] = Math.min(ary1[0],ary2[0]);
              res[1] = Math.max(ary1[1],ary2[1]);
              res[2] = Math.max(ary1[2],ary2[2]);
              res[3] = Math.min(ary1[3],ary2[3]);
         return res;
    and were called like so:
    var doc = app.activeDocument;
    if (doc.selection.length > 0) {
         var grpOriginal = null;
         if(doc.selection.length == 1 && doc.selection[0].typename == 'GroupItem') {
              grpOriginal = doc.selection[0];
         else {
              grpOriginal = doc.groupItems.add();
         doc.selection = null;
         if(grpOriginal.layer.name != 'approval') {
              grpOriginal.move(doc.layers['approval'],ElementPlacement.PLACEATEND);
         var artBounds = getRealVisibleBounds (grpOriginal);
         var artWidth = artBounds[2] - artBounds[0];
         var artHeight = artBounds[1] - artBounds[3];
         var imprintHeight = GetPoints(0.625);       // 0.625 is new height, hardcoded for demonstration
         var imprintRatio = imprintHeight / artHeight;
         var section = doc.layers['sectionLeft'];    // section where I placed the art
         var grpArt = grpOriginal.duplicate(section,ElementPlacement.PLACEATEND);
         grpArt.resize(100.0 * imprintRatio,100.0 * imprintRatio);
         grpArt.move(section,ElementPlacement.PLACEATBEGINNING);
         grpArt.selected = true;
         positionVisible(grpArt,0.0,16.75);          // x & y hardcoded for demonstration
    else {
         alert('artwork needs to be selected');
    I'm new at this so are there any better options to do these things?

  • Getting maximum width and height of frame

    In my Flash CS4 application I have a problem working out the maximum x and y coordinates of the display objects that have been created in a frame using the frame editor. This is the sequence
    1. Using the frame editor on the timeline, I create a keyframe with a mixture of library symbols and text/graphics which are not symbols.
    2. In AS3 I take all of the screen objects and make them children of a Sprite that I created in my AS3 script. I then delete the objects off the screen and pass the parent Sprite to a class that I use to manage the screen.
    3. In the manage screen class the first thing I do is go through the child display objects to work out the maximum x and y coordinates so that I can centralise them on the screen later on.
    The problem is that I'm not able to work out the maximum x & y coordinates correctly. There is no problem with the symbol objects, I just add the x and width for example, for the maximum x coordinate. But for the non symbol objects this does not work. They appear to be combined in some way and the x/y & width/height do not seem to correspond to anything in the frame editor.  
    Is there a writeup anywhere on how Flash manages the graphics/text obects which are not symbols and are created by the editor in keyframes on the timeline? Finding the maximum x and y coordinates of a screen full of objects should be fairly simple, but I cannot see a way of doing it at the moment.
    Jerry

    On my JPanel I want to draw stuff, and for this I need to know the > > width and height of the JPanelIf you are drawing stuff, then you are in control off
    how big you want to draw the stuff. You can make the
    panel as big or small as you want and do your drawing
    accordingly.But doesn't the Layoutmanager of the frame set the size of the added panel according to the rest of the layout, or am I way off here?
    Do I need to setPreferredSize() or anything on thepanel before pack()?
    Try it and see what happens. If you don't give the
    panel a size then the pack() method basically ignores
    it as you have found out.Perhaps if I gave an example, you could point me in the right direction? The code below creates a JPanel of size 200x200, and draws a ball at a random spot on the panel. But since the frame is way bigger than 200x200 the panel gets stretched by the layoutmanager (right?). So what I really want to use when I calculate the x and y position is the width and height of the panel as it is displayed in the frame.
    Here goes:
    import javax.swing.*;
    import java.awt.*;
    class MyFrame extends JFrame {
      public MyFrame() {
        super("A ball");
        JPanel panel = new JPanel();
        panel.setSize(200, 200);
        int x = (int)(Math.random()*200);
        int y = (int)(Math.random()*200);
        panel.add(new Ball(x, y));    // Object Ball draws a ball at x,y
        getContentPane().add(panel, BorderLayout.CENTER);
        setSize(640, 480);
        show();
      public static void main(String[] args) {
        new MyFrame();
    }

  • Deployment in browser: setting width and height to 100% (or any %)

    According to http://docs.oracle.com/javafx/2.0/deployment/deployment_toolkit.htm for deploying a browser embedded JavaFX application, you can set the width and heigth properties to either a fixed value or a percentage value (or, assumedly, any value the browser can accept).
    >
    width and height
    Dimensions used to reserve space for an embedded application. Could be absolute or relative (for example, 50 or 50%). (Required for embed().)
    >
    However, when I try to set a percentage value (e.g. 100%) from the Netbeans "Run" properties dialog, I get the following exception:
    java.lang.NumberFormatException: For input string: "100%"
         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
         at java.lang.Integer.parseInt(Integer.java:492)
         at java.lang.Integer.valueOf(Integer.java:582)
         at com.sun.javafx.tools.ant.DeployFXTask.execute(DeployFXTask.java:103)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)As can be seen, the exception happens in the DeployFXTask.execute method. It seems that this method requires the values to be integers.
    So the question, how can I set the embedded application dimensions to a percentage value? (Without having to edit the HTML file manually after the build - which is a workaround.)
    Edited by: Knut Arne Vedaa on 21.feb.2012 21:06

    As a workaround, in the meantime, look at the build file in the source of the Ensemble sample application (http://www.oracle.com/technetwork/java/javafx/downloads/devpreview-1429449.html) which will patch a generated html file using a custom post processing ant task - this would not work out of the box using the NetBeans generated ant build files though. You could file an issue with NetBeans to ask them to support the workaround in their generated build scripts, but they may just decide to wait until a fix is available in the core platform. As there is a workaround though, I don't think this would be classified as a showstopper issue - just a pretty annoying thing.

  • How to change the width and height of the visible part of the of the report

    I have define a report with paper size 'Letter', orientation 'landscape' and 30 columns. Dynamically I am changing width of columns and suppressing many columns of the report.
    Mostly using first 16-20 columns and others get suppressed.
    Now problem is that when navigating the report thru crystal viewer, a huge blank spaces getting display on right of the report. When we take jump to some part of report thru navigation tree, the whole report gets shifted to left and only blank part is visible and it is required to scroll left.
    Even printing is not working correctly.
    Is there any way to change the width and height of the visible part of the report in the viewer thru .net classes? Setting the width and height of the report in Load event handler doesn't help.  
    Example: CrystalReportViewer1.Width = 200; - is not helping.
    Is there any other solution?
    Please let me know.
    Thanks
    Mahesh Patel

    Hi Yogesh,
    Your suggestion 'reportDocument.PrintOptions.PaperSize=PaperSize.PaperLedger;' along with 'PaperOrientation' setting as follow works fine. I tried to switch between Landscape and Portrait depending on report width.
    reportDocument.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
    But problem with crystal viewer remain as it is.
    While navigating report thru crystal viewer, when we take jump to some part of report thru navigation tree, the whole report gets shifted to left and it is required to scroll left.
    Thanks for your very good suggestion.
    Mahesh Patel

  • Java returning incorrect values for width and height of a Tiff image

    I have some TIFF images (sorry, I cannot post them b/c of there confidential nature) that are returning the incorrect values for the width and height. I am using Image.getWidth(null) and have tried the relevant methods from BufferedImage. When I open the same files in external viewers (Irfanview, MS Office Document Imaging) they look fine and report the "correct" dimensions. When I re-save the files, my code works fine. Obviously, there is something wrong with the files, but why would the Java code fail and not the external viewers? Is there some way I can detect file problems?
    Here is the code, the relevant section is in the print() routine.
    * ImagePrinter.java
    * Created on Feb 27, 2008
    * Created by tso1207
    import java.awt.Graphics2D;
    import java.awt.Image;
    import java.awt.print.PageFormat;
    import java.awt.print.PrinterException;
    import java.io.File;
    import java.io.IOException;
    import java.util.Iterator;
    import javax.imageio.ImageIO;
    import javax.imageio.ImageReader;
    import javax.imageio.stream.FileImageInputStream;
    import javax.imageio.stream.ImageInputStream;
    import com.shelter.io.FileTypeIdentifier;
    public class ImagePrinter extends FilePrintable
       private final ImageReader _reader;
       private final int _pageCount;
       private final boolean _isTiff;
       //for speed we will hold current page info in memory
       private Image _image = null;
       private int _imgWidth = 0;
       private int _imgHeight = 0;
       private int _currentPage = -1;
       public ImagePrinter(File imageFile) throws IOException
          super(imageFile);
          ImageInputStream fis = new FileImageInputStream(getFile());
          Iterator readerIter = ImageIO.getImageReaders(fis);
          ImageReader reader = null;
          while (readerIter.hasNext())
             reader = (ImageReader) readerIter.next();
          reader.setInput(fis);
          _reader = reader;
          int pageCount = 1;
          String mimeType = FileTypeIdentifier.getMimeType(imageFile, true);
          if (mimeType.equalsIgnoreCase("image/tiff"))
             _isTiff = true;
             pageCount = reader.getNumImages(true);
          else
             _isTiff = false;
          _pageCount = pageCount;
       public int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pageIndex)
          throws java.awt.print.PrinterException
          int drawX = 0, drawY = 0;
          double scaleRatio = 1;
          if (getCurrentPage() != (pageIndex - getPageOffset()))
             try
                setCurrentPage(pageIndex - getPageOffset());
                setImage(_reader.read(getCurrentPage()));
                setImgWidth(getImage().getWidth(null));
                setImgHeight(getImage().getHeight(null));
             catch (IndexOutOfBoundsException e)
                return NO_SUCH_PAGE;
             catch (IOException e)
                throw new PrinterException(e.getLocalizedMessage());
             if (!_isTiff && getImgWidth() > getImgHeight())
                pf.setOrientation(PageFormat.LANDSCAPE);
             else
                pf.setOrientation(PageFormat.PORTRAIT);
          Graphics2D g2 = (Graphics2D) g;
          g2.translate(pf.getImageableX(), pf.getImageableY());
          g2.setClip(0, 0, (int) pf.getImageableWidth(), (int) pf.getImageableHeight());
          scaleRatio =
             (double) ((getImgWidth() > getImgHeight())
                ? (pf.getImageableWidth() / getImgWidth())
                : (pf.getImageableHeight() / getImgHeight()));
          //check the scale ratio to make sure that we will not write something off the page
          if ((getImgWidth() * scaleRatio) > pf.getImageableWidth())
             scaleRatio = (pf.getImageableWidth() / getImgWidth());
          else if ((getImgHeight() * scaleRatio) > pf.getImageableHeight())
             scaleRatio = (pf.getImageableHeight() / getImgHeight());
          int drawWidth = getImgWidth();
          int drawHeight = getImgHeight();
          //center image
          if (scaleRatio < 1)
             drawX = (int) ((pf.getImageableWidth() - (getImgWidth() * scaleRatio)) / 2);
             drawY = (int) ((pf.getImageableHeight() - (getImgHeight() * scaleRatio)) / 2);
             drawWidth = (int) (getImgWidth() * scaleRatio);
             drawHeight = (int) (getImgHeight() * scaleRatio);
          else
             drawX = (int) (pf.getImageableWidth() - getImgWidth()) / 2;
             drawY = (int) (pf.getImageableHeight() - getImgHeight()) / 2;
          g2.drawImage(getImage(), drawX, drawY, drawWidth, drawHeight, null);
          g2.dispose();
          return PAGE_EXISTS;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since version XXX
        * @return
       public int getPageCount()
          return _pageCount;
       public void destroy()
          setImage(null);
          try
             _reader.reset();
             _reader.dispose();
          catch (Exception e)
          System.gc();
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @return
       public Image getImage()
          return _image;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @return
       public int getImgHeight()
          return _imgHeight;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @return
       public int getImgWidth()
          return _imgWidth;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @param image
       public void setImage(Image image)
          _image = image;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @param i
       public void setImgHeight(int i)
          _imgHeight = i;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @param i
       public void setImgWidth(int i)
          _imgWidth = i;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @return
       public int getCurrentPage()
          return _currentPage;
        * <br><br>
        * Created By: TSO1207 - John Loyd
        * @since Mar 25, 2008
        * @param i
       public void setCurrentPage(int i)
          _currentPage = i;
    }Edited by: jloyd01 on Jul 3, 2008 8:26 AM

    Figured it out. The files have a different vertical and horizontal resolutions. In this case the horizontal resolution is 200 DPI and the vertical is 100 DPI. The imgage width and height values are based on those resolution values. I wrote a section of code to take care of the problem (at least for TIFF 6.0)
       private void setPageSize(int pageNum) throws IOException
          IIOMetadata imageMetadata = _reader.getImageMetadata(pageNum);
          //Get the IFD (Image File Directory) which is the root of all the tags
          //for this image. From here we can get all the tags in the image.
          TIFFDirectory ifd = TIFFDirectory.createFromMetadata(imageMetadata);
          double xPixles = ifd.getTIFFField(256).getAsDouble(0);
          double yPixles = ifd.getTIFFField(257).getAsDouble(0);
          double xRes = ifd.getTIFFField(282).getAsDouble(0);
          double yres = ifd.getTIFFField(283).getAsDouble(0);
          int resUnits = ifd.getTIFFField(296).getAsInt(0);
          double imageWidth = xPixles / xRes;
          double imageHeight = yPixles / yres;
          //if units are in CM convert ot inches
          if (resUnits == 3)
             imageWidth = imageWidth * 0.3937;
             imageHeight = imageHeight * 0.3937;
          //convert to pixles in 72 DPI
          imageWidth = imageWidth * 72;
          imageHeight = imageHeight * 72;
          setImgWidth((int) Math.round(imageWidth));
          setImgHeight((int) Math.round(imageHeight));
          setImgAspectRatio(imageWidth / imageHeight);
       }

  • What are the units of "Width" and "Height" of a Shape?

    What are the units of  "Width" and "Height" properties of a Shape when programming?
    Something odd like points or twips or tweedles or nibbles?
    http://www.ransen.com Cad and Graphics software

    Width and Height are properties of type Single; they represent the dimensions of the shape in points, where 72 points = 1 inch.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Finding the width and height of an image

    Hi...
    i have a path to an image "images/me.gif" and i'm trying to find its width and height.. am trying to use javax.swing.ImageIcon but it refuses to recognise the constructor with just the filename (string) parameter, and needs a URL to the file... anyone knows what i'm doing wrong??? is this the wrong class that i'm using...!??!?!?!?!?

    String filename = "images/me.gif";
    Image myImage = carregarImagem(filename);
    System.out.println(myImage.getWidth(this));
    System.out.println(myImage.getHeight(this));
    * M�todo que carrega imagens na mem�ria, a partir da URL onde o
    * applet est� sendo carregado. O uso de um 'mediaTracker' � fundamental para
    * evitar problemas quanto � velocidade de carga de uma imagem. Se voc� n�o
    * usar um mediaTracker, o seu c�digo pode tentar usar uma imagem antes dela
    * estar plenamente carregada na mem�ria, o que causaria um erro de execu��o.
    * @param nomeDaImagem O nome da imagem a ser carregada
    * @return A imagem requisitada ou null caso n�o haja tal imagem na url do applet
    public Image carregarImagem(String nomeDaImagem)
                   try
                                   Image imagem = getImage(getDocumentBase(), nomeDaImagem);
                                   MediaTracker carregador = new MediaTracker(this);
                                   carregador.addImage(imagem, 0);
                                   carregador.waitForID(0);
                                   return imagem;
                   catch(Exception erro)
                                   erro.printStackTrace();
                                   System.exit(0);
                                   return null;

  • How do I save the width and height of a photo for repeated use?

    How do I save the width and height of a picture for repeated use, rather than having to enter it each time in the 'new file' box?
    Thanks,  Ed Jackson.

    It could be that I'm older and have forgotten. I'm now 73 and will admit I have forgotten many things over the years. I have been using Photoshop since Photoshop version 3.  And can not really recall which features or changes were made in ever version of Photoshop I have installed.  Adobe has added many features over the years. The number of bugs introduce has also greatly increased after CS3.  "New Doc Sizes.psp"  in your user id preferences is edited using the two buttons in the new document dialog.
    As for guide lines in new documents Photoshop CS6 or CC seem to add some for video file presets with guide lines.  I do not know how to edit or add guide line to new doc presets. Guide line actions are easy to create. I have also seem some guideline in new documents when I did not expect any perhaps a new bug. Photoshop like most software has bugs. If you do not see Adobe new presets perhaps you copied an old  "New Doc Sizes.psp"  over Adobe's newer default file or Adobe migrared you presets and wand wiped their presets out. There are bugs. Close Photoshop down and rename your current  "New Doc Sizes.psp"  in you user id Photoshop cc preferences folder and start Photoshop it will add a dedault  "New Doc Sizes.psp"  file see if you see Adobe new presets in the new doc pull down when you select video and film...

  • Problem with Border Container width and height in %

    I want to use bordercontainer in Vgroup and specify its width and height in % form.
    But when we try to set width less than 18% or height less than 10% it takes the default values.
    Why is it so???
    Thanks in advance.
    Ronak Shah

    Probably a minWidth and minHeight set somewhere

Maybe you are looking for