question of sizing qnx.ui.display.Image

I found something weird on qnx.ui.display.Image setSize. I have an Image object do not show the expanded size that I put in the constructor, but appear in its place in the resolution of the image. But he did show well with expansion of size during the function of mouse event. I really have no idea what's going on... Thanks in advance for the help

package
{
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import qnx.ui.display.Image;

    [SWF(width="1024", height="600", backgroundColor="#cccccc", frameRate="30")]
    public class AIRHelloWorld extends Sprite
    {
        private var image1:Image;

        public function AIRHelloWorld()
        {
            image1 = new Image;
            image1.setImage('assets/abc.png'); // image resolution 57 x 57
            image1.setPosition(200, 10);
            image1.setSize(77, 77); // it does NOT display 77 x 77 size, but 57 x 57 instead
            image1.addEventListener(MouseEvent.MOUSE_DOWN, downWindow);
            image1.addEventListener(MouseEvent.MOUSE_UP, upWindow);
            addChild(image1);

Hey,.

so I have found that when you first declare the image and add it to the parent object fair instructions telling what to do. However, you give instructions to an empty object. That's how rule where a sprite has no dimension of width or height unless you add children. If this applies to this case as well. until the image is loaded to define its width and height does nothing because he has no "children" in the object. Once the image is loaded from the application he finally has dimension and can be changed. So what I recommend is to attach an event listener to listen to when the image is loaded as below:

var myImage:Image;

(...)

myImage = new Image();
myImage.addEventListener(Event.COMPLETE, onLoad);
myImage.setImage("images/ball.png");
myImage.setPosition(600,300); //dont mind this just random
addChild(myImage);

(...)

public function onLoad(e:Event):void
{
    var myImageObject:Image = (e.target as Image);
    myImageObject.setSize(myImageObject.width*2,myImageObject.height*2);

}

We load instantly, but in execution, it's not even load so nothing do for her before loading. so, once its loading you should be able to handle it if you wish. hope that helps! Good luck!

Tags: BlackBerry Developers

Similar Questions

  • Display image in form Transperent? attached screenshots

    Hello

    Help me to make the Images appearing as Transperent. Attached screenshots

    I'll have a TextInput and a search button (the feature is that the user can enter something in this TextInput and performs a search operation by pressing the search button.)

    At the first screen I need to visualize some inside this TextInput transperent Image when the mouse is focused on this TextInput, the Image will be completely Invisible.

    Now the question I would ask is, display image in form Transperent?

    Please find the screen photos attached with this thread.Post.jpeg

    Try this:

    When the control gets the focus, set the alpha to transparent.

    Then when the control loses the focus, set the alpha to make it visible again.

    Thank you

    Vackar

  • Display image on vi as myRio problem

    Hello

    This system supposed to be an easy task, but I don't know why it does not work. I am trying to create a game by myRio 1900 and I'm putting a jpeg image. However, I get an error message or an empty image on the Panel before the myRio Vi (Vi project myRio label) [see photograph below]. On the other hand, if I create the same VI under my computer, the image shows without any problem. What should I do to enlarge a picture on my VI as myRio. I need the image either on this VI because I am creating a program requiring myRio and it may not work properly if it is not under label myRio (I need its integrated sensor). I am attaching a zip file of only the part display image of the commandments and not my whole project easier to visualize.

    Problem in brief:
    Please see the project (as a zip).  The vi computer label works and the vi under myRio does not.

    I want to solve:
    I want to put an image on VI myRio label.

    I have:

    MyRio Labview 2014

    MyRio 1900

    Already tried to: (but unfortunately did not work)

    (1) put the jpeg file in the USB key and plug myRio directly. I gave the file path ' / u/bg.jpg ". (File system)

    2) created by Subvi from 'computer' then it reminds on the (main) vi under myRio. And vice versa (Subvi myRio and MainVI on 'computer')

    Please ask me any questions if you need further information. I will answer as soon as possible.

    Thanks in advance for your help,

    I am very greateful for your time.

    Stephany

    Stephany,

    It seems that reading JPEG/PNG/BMP screws are not based on targets in real time, as your myRIO. As an alternative, you can get our Vision of shared resources (I think you need to install with Vision Development Module), install Vision RT to the myRIO and use the IMAQ ReadFile VI to open the file on the myRIO.

  • Cybershot - cannot display Image

    so. Disgusted and increased.  Bought this Cybershot DSC-W730 to take a trip to Colorado.  Probably took 30 shots or so and after that of course the image appears in the Viewer on the camera itself so cool, that's where!  EVIL.  On the return plane trip I will look through the travel plans, and more than half of them have a blue screen that says: "cannot display image".  Then I load the software on the computer to download a few shots that ARE there and most of them are just a square with a small blue flower looking icon in the corner... no image. Some of them have a thin line of part of the image.  Where are our pictures?  Thanks for any help.

    It may be possible that the photos you have taken have been corrupt. Using a memory card with the camera? If so, it would be possible that the card is not compatible, not formatted correctly or damaged and corrupt.

    You can try to format the card, but this will clear all the photos you've already taken. Please try to use another memory card to isolate the problem.

    If this post answered your question, please mark "accept as a Solution.

  • XML not displaying images

    I have a problem displaying images from an xml file. It's a portfolio site, so roughly that it displays text and an image. All text works fine, but for some reason any image (and the entire application) does not appear when the code of the image is added.

    Here is my code:

    "" < mx:XML id = "portfolioXML".
    source = "portfolio. XML"/ >

    < mx:XMLListCollection id = "interActXMLList".
    source = "{portfolioXML.interactive.label}" / >

    < mx:List id = "interActList".
    dataProvider = "{interActXMLList}".
    width = "253" height = "103" / >

    < mx:Number id = "selectedWorkIndex" > {interActList.selectedIndex} < / mx:Number >

    < mx:Text
    ID = "titleInput".
    Text = "{portfolioXML.interactive [selectedWorkIndex] .title}".
    width = "446" / >

    < mx:Text
    ID = "description".
    Text = "{portfolioXML.interactive [selectedWorkIndex] .shortDesc}.
    height = "101" width = "446" / >
    <!-this causes it to crash
    < mx:Image
    source = "{portfolioXML.interactive [selectedWorkIndex] .image}" / >
    ->

    XML looks like this:

    < portfolio >
    < interactive >
    < label > The point < / label >
    < title > element < /title >
    < shortDesc > the question is totally awesome. < / shortDesc >
    < image > http://www.example.com/images/interactive/item.png < /image >
    < / interactive >
    < / portfolio >

    The url is correct (it works when I hard code). Anyone know why images do not work?

    In my tests, I found the var 'selectedWorkIndex' to be the problem. In fact, it's a timing issue as this var is not set before trying to load the image. I reinforced with your code and I saw that the image will load before your number var is defined. Bad luck. That causes the error.

    If you need to write a little Actionscript code to define things upwards and load the image correctly.
    I created a var for the SOURCE property of the image control, and I put this var in the creationComplete for the app Manager and a handler for the event of CHANGES to the list. Voila!

  • I forgot my apple ID sequrity question, several times I tried to reset my sequrity question but there is no display on the window to reset (reset sequrity awnser) .please help me.thanks

    I forgot my apple ID sequrity question, several times I tried to reset my sequrity question but there is no display on the window to reset (reset sequrity awnser) .please help me.thanks

    Hello

    You will need the answers to your security questions.

    Follow the instructions here > If you forgot your Apple ID - Apple Support security questions answered

  • When "allow pages to choose their own colors, instead of my selections above" is not checked in the menu options, I can't see images on Web sites. How can I maintain with the box unchecked and always display images?

    I recently decided to spend autour colours in Firefox. I work in a fairly dark environment and have the dark color on white or light background text is quite difficult on my eyes in the dark.

    I changed the background to a dark gray, light gray text and visited the two and links not visited in a blue light. With these changes, I unchecked the "allow pages to choose their own colors, instead of my selections above" box.

    After unchecking the box, I'm more able to display images on many sites. Turn all grey images - as if Firefox has changed their image in part of the background. When I check the box, I am able to see fine pictures, however, Web sites typically return to their light background with dark text.

    Any help and assistance with this is greatly appreciated!
    Thank you!

    You can use the NoSquint extension to define the font size (zoom text/page) and colors of text on web pages.

  • last mozilla does not display image in yahoo personals email, just black squares.

    Latest version of firefox does not display image in yahoo personals email, just black squares

    This has happened

    Each time Firefox opened

    is latest update of firefox

    See the problems that cause to not show images and http://kb.mozillazine.org/Images_or_animations_do_not_load

    It is possible that you clicked the 'Block Images' item in the context menu by attempting to save an image.
    Check the image exceptions: Tools > Options > content: Load Images: Exceptions - see the web content, pop-ups, fonts and language settings

    A way to see what images are blocked is to click on the favicon (Site ID icon) on the left side of the address bar and click the button "additional information".
    This will open the Security tab of the window of the Information Page (also accessible via Tools > Page Info).
    Go to the Media of this Page Info window tab.
    Select the first image and scroll though the list with the arrow pointing downwards.
    If a picture is grayed out and there is a check mark in the box of block Images of... then remove this brand in order to unlock the images from this area.

  • Display images from a folder

    I'm looking to display images from a folder of images containing mostly jpg images. I want to be able to display images on the façade and cycle through them with a button. How can I do this?

    LabVIEW 2013

    This is the solution, if anyone needs

  • How to adjust display image horizontal display

    everytime I turn on my labtop, the image would jump to display vertically and not horizontally, which is the setting of display image of normal labtop, what key I have by mistake, press

    High graphics most of range, the cards are equipped with display rotation built in and adjustable via display properties or via the display properties of the display icon in the Notification area (to the left of the system clock).  It is a nice feature if you want to read things more like a book on your laptop, etc.

    Some examples would be ATI, NVIDIA, Intel, Matrox, S3, XGI...  These adapters can be integrated into your system, and not always his own card.

    This phenomenon of rotation screen sometimes inadvertently some keystrokes (the cat walked on my keyboard).

    Pressing on the keys Ctrl-Alt top/arrow down arrow rotates screen 90 degrees at a time for some graphics (like NVIDIA) cards

    If this does not work, we will need to know your system brand and model and see if we can look at the rotating screen for you shortcut keys.

  • I can't display image icons when working with my photo folder. How can I see the photos without having to click on them in preview mode?

    I can't display image icons when working with my photo folder. How can I see the photos without having to click on them in preview mode?

    -It used to work and for some reason, now it does not work

    Greetings, d_chiuch1104,

    There is one thing that I know that you need to check that COULD be your problem.  Open Control Panel (in Classic view) and click Folder Options (or, in Control Panel, click on appearance and personalization and then Folder Options).

    Open the view tab and make sure that "Always show icons, never thumbnails" is NOT checked.

    It would be good to hear from you as to whether that was the problem!

    GL - Bob

  • Album App do not display images of internal storage

    Hello
    I use a ultra Xperia Z

    I always have problems with my album app, it shows no content from the internal memory, but only from SD card. I tried to clear the cache of data and restarted the phone, but it does not help. I recently updated my OS to lollipop 5.1.1 it worked once, but as soon as I plugged the phone on the laptop it stopped to show the content of the internal memory. He gave me problems even if you use 4.4.2

    The version of the album App is 7.3.A.0.4, please make a permanent fix because it's very annoying to have to go through the file Commander to display images from the internal memory.

    Thanks in advance

    When you try to change something on the external SD card using advantage 3:rd app, you must allow access to the application.

    In Total Commander you have to get a popup saying 'Write protected!', then press 'OK', then select the SD card on the left side menu och then press "confirm" at the bottom. Total order then deletes the file.

    And when the file has been deleted, don't forget to erase the data to storage media and then reboot the phone. It can also take a little while for the phone to analyze all of the media, which may take a little while before, you see all the pictures.

    Which you must use the file manager is a matter of preference. You can have both installed if you want to.

  • sidebar on the desktop are not displayed images of only a red cross

    sidebar on the desktop are not displayed images of only a red cross

    Take a look at the following:

    Sidebar Gadget not working not properly
    Note: look for responses from the veebull
    and president of the DNA
    http://social.technet.Microsoft.com/forums/en/itprovistadesktopui/thread/5d734cdb-757f-4801-8f28-3cca36ccf7ba

    How can I restore windows sidebar
    http://support.Microsoft.com/?kbid=963010

    How to fix broken sidebar
    http://www.howtogeek.com/HOWTO/Windows-Vista/how-to-repair-your-crashed-or-hanging-Vista-Sidebar/

  • Impossible to change the wallpaper, the location of the image does not display images.

    Original title: photo location not display images

    I'm trying to access my pictures folder and select a background for my office. But when I search for the location of the image and select the folder of the screen does not display images, even if the pictures are present in the folder. The screen shows only 'solid colors.
    I moved to the location of my pictures, sounds and video to another folder. Then, the default folders are different.
    In Explorer when I just click on the photos forlder ther is a location tab saying my it's the default folder.
    One last thing.
    If I go to explore and navigate to the folder my pictures, right click on a picture and select 'Set as wallpaper', then it displays the content and the folder.

    Any ideas?
    James

    I got it working again.
    And that's a good reason to not mess with the registry.
    I have used a tweak registry to hide the libraries in the Explorer navigation pane. Once I've restored it Windows seems to have found the files for my photos. I then re - hid libraries and everything seems to work ok.

    James

  • Windows Live Photo Gallery: Error Code 0 x 8007000. an error is preventing the photo or video to be displayed, unable to display images.

    I have Windows 7 64 bit. I can't see the photos with Windows Live Photo Gallery. If I try I get this error: error code 0 x 8007000. an error is preventing the photo or video to be displayed, unable to display images. I can open the images with other applications.

    Can you access the properties of the files and check your username on the Security tab on the computer that has problems with them, opening

    Not being able to do something with these points of shared files to a problem of permissions with the files.

    You should also ask for help on this forum,

    Sometimes, it takes 3 or 4 days before a tech react,

    http://windowslivehelp.com/forums.aspx?ProductID=20

    Better put online now.

Maybe you are looking for