Get the widths of landscape and portrait

Hi all

Is it possible to get the width of the landscape of a screen (or just the screen) while the device is in portrait orientation and without rotation/tilt physically the device? and vice versa?

The only way that I can think of is to force the screen in, say, portrait landscape (via Ui.getUiEngineInstance () .setAcceptableDirections (Display.DIRECTION_LANDSCAPE)), out of Display.getWidth () and then force back in orientation. I don't know if it will even work or is the the best/most simple method.

Any help?

Thank you

The safest way to get the current width/height is to override the sublayout() method appropriate to the screen, Manager, etc. and update the required values (e.g. update of width of the button). that is when orientation changes, a sublayout is triggered, where you update buttons as. Inside of the paint just function use the measurement buttons to draw the dimensions for the size of the newer buttons based on the available width. Database available on the values provided by the call to sublayout instead of Display.getxxxxx values.

Tags: BlackBerry Developers

Similar Questions

  • How do I get the width and height of an external image

    Hello

    lets say I want to get the width and/or height of this external image (it could also be an external file on my hard drive): http://www.icatcher.com/wp-content/uploads/2013/01/Adobe.PNG

    I create a button and add an onClick function that says:

    var externalImageWidth = ???
    alert(externalImageWidth);
    

    How can I do (so to speak dynamically?)  without the addition of the image itself to my library or put it on the stage?

    All my attempts said 'indefinite' or '0' or they simply do not work.

    Thanks in advance!

    You can try the following (assuming that there is a dummy container with id mydiv = div),

    var img = new Image();

    IMG. OnLoad = function() {}

    SYM. $("mondiv") .attr ("width", this.width) .attr ("height", this.height) .append (this);

    };

    IMG. SRC = "http://www.icatcher.com/wp-content/uploads/2013/01/Adobe.png";

    Modify the code according to your need for the selection of the container element.

    DIA-

  • How to get the width and height of Flex Mobile view?

    Hello

    The following instructions can get the width and height of the current Flex app:

    var request: UIComponent = FlexGlobals.topLevelApplication as UIComponent;

    trace (application. Width);

    trace (application. Height);

    But I don't know how to get the width and height of mobile display Flex current (i.e. the content size excludes bar action and the Navigation bar). Why the "this.width" always returns 0?

    Thank you!

    Looks like you're running in this bug: https://bugs.adobe.com/jira/browse/SDK-30070

  • Get the width and height of the image

    Hi scripters

    I try to get the width and height of my image file. Here is my code

    myPicFile = File("c:\\ar.eps");

    h = myPicFile.height;

    w = myPicFile.width;

    Alert (h)

    Copy the following code generates error

    ---------------------------
    Script alert
    ---------------------------
    undefined
    ---------------------------
    Ok
    ---------------------------

    How can I get the height and the width of my image? is there another method?

    Thanks in advance

    concerning

    a you are the

    Dear Arul,

    Here, my code is in InDesign. I don't know that we get the size of the Image directly. ?

    Throught InDesign [you using the InDesign Script then] Script here I pasted the code below...

    = Image height / width =.

    myDoc var = app.activeDocument;

    myPicFile = file ("E:\\HariharaSudhan\\Blue hills.jpg");

    App.place (file (myPicFile);

    = Then u please select the Image file in InDesign and then you run the script = / /.

    mySel var = app.selection [0];

    var limit = mySel.geometricBounds;

    var height = related [2] - bound [0];
    var width = Bound [3] - bound [1];

    Alert ("Image Height:" + height + ""+"Image width:" + width);

    = End: getting the Image height / width =.

    Please let me know if you have any questions.

    Thank you & best regards

    Thierry T.R.Harihara

  • The mode switching landscape to portrait, what do I do next?

    Hello everyone. I have installed the accelerometer in my application, configure the headphones, created a State of 'portrait '. What is the call to change the status of my _accelerometer.onUpdate ()?

    If you try only to have your app support landscape and portrait orientations, I wouldn't bother using the accelerometer.

    Listen for the StageOrientationEvent.ORIENTATION_CHANGE event or that I am in my application current just monitor Event.RESIZE and don't worry 'landscape' versus 'portrait', but rather just meet the width and height of the actual values.

    I know the tricks of the Tablet OS developer's guide shows an example of using the accelerometer, but I must say it mystifies me why they bother proposing this solution.

  • Get the width/height of the current image / information of KING of user input

    Hello

    I have two problems:

    First of all:

    Y at - it an option to get the width and height of the image to use for calculations or set a return on investment for the right settings?

    Second (more complicated):

    I have used Labview 8.5 custom interface (see the interface.jpg attachment).

    I am trying to get the return on investment of the Interface and use it in my app Builder of Vision, but I don't see the return on investment or its size or position or something...

    Is it possible to get this information from the Interface?

    Information:

    I use Vision Builder 2009 SP1, LabVIEW 8.5

    Thanks for your replies!

    Hello

    I missed that when I tested it... the display image control must have been larger than the size of the image and the property node returned the value that I expected.

    A restriction of the VI to Interface custom that you create in LabVIEW, is that it cannot have any dependencies (call any subgroup screws), other than the methods and the nodes property of the objects you put on. Therefore, I can't just call IMAQ GetImageSize her. So it does not seem possible at this point for the VI of custom Interface return the size of the image.

    The solution, at this stage, to get the size of the image of the Interior Vision Builder AI, is to use a step in LabVIEW Run, calling a simple VI that takes an image as input, called IMAQ GetImageSize and return res X and Y.

    Note that for purposes of distribution, when you call a VI using a LabVIEW execution step, you must save it as a source distribution in a Bachelor's degree in LAW and you must redistribute this llb with your inspection. See using setup step run LabVIEW for more details.

    Sorry there is no better way to do this now.

    Best regards

    Christophe

  • How to change laptop screen between landscape and portrait?

    How to change laptop screen between landscape and portrait?

    I have an ACER ASPIRE 5335 running Windows 7 Pro 32 bit and using the Intel Graphics Media Accelerator driver who pointed out that I use the Chipset Intel 4 Series Express.

    I tried the things:

    1: from the keyboard - Ctrl-Alt-Left/Right Arrow (worked with Vista) no change

    2: Control Panel/display/resolution/Advanced Settings - tab Intel -Intel Graphics and Media Control Panel /Options and support/Hotkey Manager - the value of the Hotkey - active (worked with Vista) feature no change

    3: in the notification area - right click Intel display options icon/graphic/rotation - click ' 90 or 270' (worked with Vista) no change

    4: right-click and open Intel Graphics and Media Control Panel /Options and support/Hotkey Manager - the value of the Hotkey - active (worked with Vista) feature no change

    Help please,

    The man from FarAway

    Windows does not include hardware drivers or a screen rotation capabilities.  As your hardware or the hardware driver software does not change, it may indicate that you must reinstall the software, perhaps with a more recent version, you can do it from the manufacturer's website.  Alternatively, because the function doesn't do not part of the Windows operating system, you need to contact Acer support.

    If it solves your problem, click on the link "Propose as answer" below and vote as useful by clicking on the green triangle for the lelft. Thank you!

  • Get the width of the dynamic text boxes containing different letters

    I have boxes of dynamic text next to each other, each showing a letter and the creation of a Word, any letter English ABC. Given that some letters are wider, how could I get the width of each letter to figure out spacing between them?

    Thank you!!

    You can use the textWidth of textfield property to get the width of the text inside.

  • Get the width of the BlobDomain image as a transitional attribute in a ViewObject problem

    Hi, I need your help. What I want to do is to get the width or the
    height of the image as a maximum limit, but I get a
    java.lang.NullPointerException.

    I create a table like this

    CREATE TABLE IMAGE)
    ACTIVATE THE ID NUMBER NOT NULL,
    IMAGE BLOB,
    CONSTRAINT IMAGEN_PK PRIMARY KEY (ID)
    )

    I create business for this table components and in the view object I
    Create a transient type Boundary String attribute. In the java
    ImageViewRowImpl I replace the accessor method to get the width of the class
    or the height of the image as a maximum limit.

    public String getBoundary() {}
    try {}
    InputStream is = getImage1 () .getBinaryStream ();
    BufferedImage bi = ImageIO.read (is);
    width int = bi.getWidth ();
    height int = bi.getHeight ();
    if(Width>heigth)
    Return Integer.toString (width);
    on the other
    Return Integer.toString (heigth);
    } catch (IOException e) {}
    e.printStackTrace ();
    Returns a null value.
    }
    }

    The problem is when I run the application module cause I get a
    java.lang.NullPointerException when the method is call. It comes to stacktrace:

    oracle.jbo.AttrValException: Houston-27019: No. is ha resolver el Método could get para el atributo 'Limit' in ImageView1.
    at oracle.jbo.server.ViewRowImpl.getAttribute(ViewRowImpl.java:883)
    at oracle.jbo.uicli.binding.JUCtrlValueBinding.internalGetAttributeValueFromRow(JUCtrlValueBinding.java:1157)
    at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeFromRow(JUCtrlValueBinding.java:751)
    at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeFromRow(JUCtrlValueBinding.java:779)
    at oracle.jbo.uicli.binding.JUCtrlAttrsBinding.updateValuesFromRow(JUCtrlAttrsBinding.java:145)
    at oracle.jbo.uicli.binding.JUCtrlAttrsBinding.refreshControl(JUCtrlAttrsBinding.java:245)
    at oracle.jbo.jbotester.BindingAdapter.refresh(BindingAdapter.java:69)
    at oracle.jbo.jbotester.panel.CardPanel.refreshAll(CardPanel.java:128)
    at oracle.jbo.jbotester.panel.RowSetPanel.refreshAll(RowSetPanel.java:206)
    at oracle.jbo.jbotester.panel.RowSetPanel.showCard(RowSetPanel.java:236)
    at oracle.jbo.jbotester.panel.RowSetPanel.setIterator(RowSetPanel.java:105)
    at oracle.jbo.jbotester.panel.BindingPanel.setBindingContext(BindingPanel.java:118)
    to oracle.jbo.jbotester.panel.BindingPanel. < init > (BindingPanel.java:88)
    to oracle.jbo.jbotester.panel.BindingPanel. < init > (BindingPanel.java:71)
    at oracle.jbo.jbotester.form.BindingForm.createMasterPanel(BindingForm.java:63)
    at oracle.jbo.jbotester.form.BindingForm.init(BindingForm.java:98)
    to oracle.jbo.jbotester.form.JTForm. < init > (JTForm.java:72)
    to oracle.jbo.jbotester.form.BindingForm. < init > (BindingForm.java:50)
    to oracle.jbo.jbotester.form.FormType$ 1.createForm(FormType.java:63)
    at oracle.jbo.jbotester.form.FormType.createForm(FormType.java:199)
    at oracle.jbo.jbotester.form.FormType.createTab(FormType.java:270)
    at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:248)
    at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:207)
    at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:203)
    at oracle.jbo.jbotester.tree.ObjTreeNode.showForm(ObjTreeNode.java:140)
    at oracle.jbo.jbotester.tree.ObjTreeNode.showForm(ObjTreeNode.java:123)
    at oracle.jbo.jbotester.tree.Tree.processTreeMouseClicked(Tree.java:728)
    in oracle.jbo.jbotester.tree.Tree.access$ 100 (Tree.java:96)
    to oracle.jbo.jbotester.tree.Tree$ TreeMouseListener.mouseClicked (Tree.java:141)
    at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
    at java.awt.Component.processMouseEvent(Component.java:6266)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6028)
    at java.awt.Container.processEvent(Container.java:2041)
    at java.awt.Component.dispatchEventImpl(Component.java:4630)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.java:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2475)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.lang.NullPointerException
    to the model. ImageViewRowImpl.getBoundary (ImageViewRowImpl.java:139)
    to the model. ImageViewRowImpl$ AttributesEnum$ 3.get(ImageViewRowImpl.java:47)
    to the model. ImageViewRowImpl.getAttrInvokeAccessor (ImageViewRowImpl.java:171)
    at oracle.jbo.server.ViewRowImpl.getAttribute(ViewRowImpl.java:864)
    ... more than 49
    # # 0 in detail
    java.lang.NullPointerException
    to the model. ImageViewRowImpl.getBoundary (ImageViewRowImpl.java:139)
    to the model. ImageViewRowImpl$ AttributesEnum$ 3.get(ImageViewRowImpl.java:47)
    to the model. ImageViewRowImpl.getAttrInvokeAccessor (ImageViewRowImpl.java:171)
    at oracle.jbo.server.ViewRowImpl.getAttribute(ViewRowImpl.java:864)
    at oracle.jbo.uicli.binding.JUCtrlValueBinding.internalGetAttributeValueFromRow(JUCtrlValueBinding.java:1157)
    at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeFromRow(JUCtrlValueBinding.java:751)
    at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeFromRow(JUCtrlValueBinding.java:779)
    at oracle.jbo.uicli.binding.JUCtrlAttrsBinding.updateValuesFromRow(JUCtrlAttrsBinding.java:145)
    at oracle.jbo.uicli.binding.JUCtrlAttrsBinding.refreshControl(JUCtrlAttrsBinding.java:245)
    at oracle.jbo.jbotester.BindingAdapter.refresh(BindingAdapter.java:69)
    at oracle.jbo.jbotester.panel.CardPanel.refreshAll(CardPanel.java:128)
    at oracle.jbo.jbotester.panel.RowSetPanel.refreshAll(RowSetPanel.java:206)
    at oracle.jbo.jbotester.panel.RowSetPanel.showCard(RowSetPanel.java:236)
    at oracle.jbo.jbotester.panel.RowSetPanel.setIterator(RowSetPanel.java:105)
    at oracle.jbo.jbotester.panel.BindingPanel.setBindingContext(BindingPanel.java:118)
    to oracle.jbo.jbotester.panel.BindingPanel. < init > (BindingPanel.java:88)
    to oracle.jbo.jbotester.panel.BindingPanel. < init > (BindingPanel.java:71)
    at oracle.jbo.jbotester.form.BindingForm.createMasterPanel(BindingForm.java:63)
    at oracle.jbo.jbotester.form.BindingForm.init(BindingForm.java:98)
    to oracle.jbo.jbotester.form.JTForm. < init > (JTForm.java:72)
    to oracle.jbo.jbotester.form.BindingForm. < init > (BindingForm.java:50)
    to oracle.jbo.jbotester.form.FormType$ 1.createForm(FormType.java:63)
    at oracle.jbo.jbotester.form.FormType.createForm(FormType.java:199)
    at oracle.jbo.jbotester.form.FormType.createTab(FormType.java:270)
    at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:248)
    at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:207)
    at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:203)
    at oracle.jbo.jbotester.tree.ObjTreeNode.showForm(ObjTreeNode.java:140)
    at oracle.jbo.jbotester.tree.ObjTreeNode.showForm(ObjTreeNode.java:123)
    at oracle.jbo.jbotester.tree.Tree.processTreeMouseClicked(Tree.java:728)
    in oracle.jbo.jbotester.tree.Tree.access$ 100 (Tree.java:96)
    to oracle.jbo.jbotester.tree.Tree$ TreeMouseListener.mouseClicked (Tree.java:141)
    at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
    at java.awt.Component.processMouseEvent(Component.java:6266)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6028)
    at java.awt.Container.processEvent(Container.java:2041)
    at java.awt.Component.dispatchEventImpl(Component.java:4630)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.java:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2475)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)



    I´ll appreciate a lot any help you can give me, thank you and sorry for my English.

    How can I test this? I don't have the DB or data.

    You must at least close the stream and the input stream of the blob field, otherwise you can read the blob again until the next retrieval from the database.

    public String getBoundary() {
    try {
    BlobDomain blob =  getImage1();
    InputStream is =blob.getBinaryStream();
    BufferedImage bi = ImageIO.read(is);
    is.close();
    blob.closeInputStream();
    int width = bi.getWidth();
    int heigth = bi.getHeight();
    if(width>heigth)
    return Integer.toString(width);
    else
    return Integer.toString(heigth);
    } catch (IOException e) {
    e.printStackTrace();
    return null;
    }
    }
    

    Try this...

    Timo

  • photos has not been loaded for weeks (usually the browser chrome on PC windows at work).  I tried now on some other computers and get the same error message and I report every time.  can I do or just wait for someone to fix it

    photos has not been loaded for weeks (usually the browser chrome on PC windows at work).  I tried now on some other computers and get the same error message and I report every time.  is there anything I can do or just wait for someone to fix it?

    If you want any help here, you'll have to tell us what the error message.

    Which report you errors to?

  • Since the change of Tiscali to TalkTalk if I click on links in the emails read on webmail, I get the following error message and then I get disconnected from your

    Since the change of Tiscali to TalkTalk if I click on links in the emails read on webmail, I get the following error message and then I disconnected from TalkTalk webmail.

    HTTP status 404 - /cp/templates/applications/mail/html/null.jsp type status report

    message /cp/templates/applications/mail/html/null.jsp

    Description the requested resource (/ cp/templates/applications/mail/html/null.jsp) is not available. Apache Tomcat/5.5.27

    can you help
    

    Please contact the webmaster. The webmaster will then contact us if they need our help. Thank you!

  • I get the pop-up windows and windows that automatically open on my browser, how can I solve this

    I get the pop-up windows and windows that automatically open on my browser, how can I solve this

    Do a scan for adware with Malwarebytes: http://malwarebytes.org/antimalware/mac.

    (copy and paste the link above into the address bar of your browser).

  • Cannot attach email word documents get the message 'enable documents and data '.

    Cannot attach a word document to an email. I get the message 'Enable documents and data' and it says that it is disabled. Don't enter iCloud setting there is no Document and data parameter. Is it because I use a free version of work?

    Whether the app is the word document?

    You can view the document word on the iPad?

  • Why an I get the test page yellow and black with each print job. I have a HP PSC 1350

    Why an I get the test page yellow and black with each print job? I have a HP PSC 1350

    Hi - I assume that the page that you see printed is the alignment page.  This happens usually if the alignment process has not been made.  All you should have to do is take the printed alignment page and place it face down on the scan scanner glass and press.  Who must complete the alignment process and eliminate the page printing every time.  If you have problems, try following the procedure described in this document.

    Hope that helps.

  • My new system see the the old system in the network, but I can't get the passwords to work and I tried all the. Now what?

    ESTABLISHING A NETWORK.

    My new system see the the old system in the network, but I can't get the passwords to work and I tried all the. Now what?

    Hello

    1. don't you make changes on the computer before the show?
    2. what version of operating system you are using on the computer?
    3. which network you're talking about (home wireless network or group)?
    4. which steps have tried?


    If you use a group home on the computer, see the link for more information.
    Home Sweet homegroup
    http://Windows.Microsoft.com/en-us/Windows7/help/home-sweet-HomeGroup-networking-the-easy-way

    You can also check out the link.
    Microsoft's strategy concerning lost or forgotten passwords
    http://support.Microsoft.com/kb/189126

     
    Provide us more information for you to help.

Maybe you are looking for