How to load an image on the screen?

Purpose: Load an image on the screen.

Error: I can load the button and the label on the screen, except an image.

Question: something wrong in my code? or other parameters must be implemented. (bar_descriptor.xml, ownership of the project, etc.).

Mini code:

#include

Test::test (bb::cascades:Application * app):
QObject (app)
{

Container * imageContainer = new Container();

day = ImageView::create ("asset/myDefaultImage.jpg");
"asset:///myDefaultImage.jpg" in case of failure
asset/myDefaultImage.jpg failure
day-> setVisible (true);

imageContainer-> add (day);

App-> setScene(Page::create().content(imageContainer));)

}

HPP

The class test: public QObject
{
Q_OBJECT

public:
Test (bb::cascades:Application * app);
~ Test();

private:
ImageView * day;

};

Thank you for your attention,

Final Soluton:

Declare assets in the bar - descriptor.xml

assets

Tags: BlackBerry Developers

Similar Questions

  • Help! How to put bitmap image on the screen?

    I spend days trying to make super simple application with a bitmap to the screen.

    image.PNG

    nothing works ;(

    I tried this:

    http://supportforums.BlackBerry.com/T5/Adobe-AIR-development/add-a-bitmap-to-the-screen/m-p/964803#M...

    do not work. It says "Call to a method maybe not defined Image."

    Can someone give / refer to the super simple code example that works?

    I'm using Flash Builder 4.7

    PSI made soft with Flash Pro it was easy but it seems that Flash Builder needs degree in rocket science

    any help is appreciated! Thank you

    Looks like there is something wrong with the SDK. Since you are using Flash Builder 4.7, I think that there is a different approach to the installation of the SDK

    If you want to go for pure AS3, try this

    (your image must be in a subfolder called 'active')

    package
    {
        import flash.display.Bitmap;
        import flash.display.Sprite;
    
        [SWF(width="1024", height="600", backgroundColor="#404040", frameRate="60")]
        public class Test extends Sprite
        {
            [Embed(source='assets/image.png')]  public static const MyImage : Class;
    
            public function Test()
            {
                initBGR();
            }
    
            private function initBGR():void
            {
                var myImg:Bitmap = new MyImage();
                var mySprite:Sprite = new Sprite();
                mySprite.addChild(myImg);
                mySprite.cacheAsBitmap = true;
                addChild(mySprite);
            }
        }
    }
    

    (do not know if 'static' should be there)

  • How to display an image on the screen

    I am currently using the following code

    InputStream imageStream = app.getClass().getResourceAsStream("/resources/map.png");
    byte[] data = new byte[2430]; // Store the contents of the image file.
    imageStream.read(data); // Read the image data into the byte array.
    EncodedImage image = EncodedImage.createEncodedImage(data, 0, data.length);
    BitmapField bmpField = new BitmapField();
    bmpField.setImage(image);
    divisionScreen.add(bmpField);
    

    But it does nothing on the divisionScreen. The same screen has some listechamps as items that normally appear. I want to display the image above the items in this list.

    Thanks in advance

    Hello

    Try this way adding image if it works then something is wrong with the wqay you do

    Bitmap objHeaderImage = Bitmap.getBitmapResource ("88Header.png");

    BitmapField = objHeader = new BitmapField (objHeaderImage);

    Note Add the image to your project by right-clicking on your project and selecting Add files.

    This is perhaps the reason why your original way did not work.

    I would like to know if it works or not.

  • How to duplicate an image on the main screen so that I can edit and compare the result with the original?

    12 elements how to duplicate an image on the screen (as well as the photo tray) so that I can compare any edition with the original?

    1. In the full Editor, go to Edition > Preferences > general and check "enable floating Documents in full Edit Mode".
    2. Open the image so that you can see in the project bin
    3. Right-click in the thumbnail of the image in the project bin and doubles. It will come as a xxxcopy
    4. On the icon to reorganize at the top, select 2-top. You should see the original and the duplicate in the work area
  • How to add the background image to the screen

    Hi all

    I want to add the background image to the main screen how can I do it.

    On the main screen, I used

    -a manager of HorizontalFieldManagerField to view the bitmapField (horizontally).

    -a manager of VerticalFieldManagerField to view the bitmapField (vertically).

    already images of display screen (bitmap field) with Horizontal and Vertical Manager, but I also want to display the background image for the screen, how can I reach this help me please.

    Concerning

    Adkins

    Thanks for all the response, I tried and sloved logic here how I did

     VerticalFieldManager mainVerticalManager = new VerticalFieldManager(Manager.NON_FOCUSABLE|Manager.NO_HORIZONTAL_SCROLL|Manager.NO_VERTICAL_SCROLL){
                protected void paintBackground(Graphics graphics)
             {  
    
             }
             protected void sublayout( int maxWidth, int maxHeight )
             {
    
             }
            };
    
    then i added other to manager on to this
    

    My problem is sloved thank you for the reply

  • . How to adjust the appearance of the image on the screen when you use the projector

    I just got my new laptop with Windows 7 Professional. When you use a projector the screen image does not fully cover the screen. How can I adjust? I would like to watch when you use a projector like the screen of my laptop screen is normally. Thank you

    Hi Dana51,

    You may need to change the settings in the projector to adjust the image to the screen.

    You can refer to the manual of the projector for the same.

  • 6 of Lightroom. When I opened to develop & load an image from the image after is removed a pale blue screen.  If I shared the screen I can see the front of the image but the image after rest as a blue screen. Clues please?

    When I opened to develop & load an image from the image after is removed a pale blue screen.  If I shared the screen I can see the front of the image but the image after rest as a blue screen. Clues please?

    Most likely, LR has problems talking to your video card.

    In the Preferences dialog box, tab Performance, disable the use of the GPU.

  • How can I place two images on the screen?

    Hello

    I need to compare two images on the screen to see the colors are the same.

    How can I place two or three images on screen from Lightroom?

    Thank you for reading

    Lightroom allows you to use the comparison mode in the library Module, select the two images desired and press c.

    Also in the library Module is mode of investigation where you can select two or more wanted images, then press n.

  • How to crop the image to the screen?

    I use first Pro CC to create "how to" videos and videos of training for a software application. I recorded the videos on my laptop and unfortunately could not specify that only the application was registered. Accordingly, I have bleeding around the low - and straight edges where you can see my laptop background. Is it possible to crop the area and only end up with the portion of the image of the screen I want to keep?

    Add the cropping effect

  • During the import of my camera or a file in Lightroom 5 my pictures are too exposed by 1-2 stops, while they are well exposed on the screen of the device. How to get the "right-exposed images on the screen?

    During the import of my camera or a file in Lightroom 5 my pictures are too exposed by 1-2 stops, while they are well exposed on the screen of the device. How to get the "right-exposed images on the screen?

    There is an option in your Lightroom preferences, under the general tab, "treat JPEG files next to raw in form of images". If you have this option is checked, then Lightroom will import and view your first two and JPEG files. You use the active D-lighting on your camera? If you are, you must disable this feature.

  • How to load an image stored in the database to the point of the Image

    Hi all

    Please help me to load an image to an element of the image, the IMAGE is stored as BLOB in the database.

    Please give me the code to load that image into the next key element based on certain conditions as employee number should correspond with the identification number of the photo.

    Thanks in advance.

    If you have a table with a column of type blob and some identify and want to show this blob content as a picture in a form?

    -Create a new block based on this table, make sure that the element type of the blob column is image.
    -In the key-nextitem (or another location where you want to upload the image), put something like:

    GO_BLOCK('IMAGEITEMBLOCK');
    SET_BLOCK_PROPERTY('IMAGEITEMBLOCK', ONETIME_WHERE, 'ID=' || varContainingTheIdValue);
    EXECUTE_QUERY;
    
  • Satellite Pro M10: image on the screen is very dark

    I have a portable Satellite Pro M10, which has a black screen, i.e. the backlight does not work. There is an image on the screen, but it is very dark. When you connect an external monitor, I get a normal picture on this screen.

    Information from other messages here, I conclude that there is a problem with the backlight of the lcd screen or the inverter. I checked all connections, but it does not solve the problem. If I bring the laptop to a service center how much it will cost about for repair? The thing is 2-3 years, so if it is very expensive I could better get a new laptop.

    I'm sure I'll be able to change the inverter Board myself, but how am I going to be able to determine that the inverter is the problem? How to get a new inverter? Is anyone of you know the number of good product?

    My Pro M10 itself has PS630E-G205Z-OF product number.

    Hello

    I agree with Tobi. You sounds description as a faulty FL inverter.
    This part is placed behind the LCD screen under the lid.
    As mentioned this part isn t very expensive and you could order the partner of Toshiba service in your country. But be aware that if you have no experience of replacement if you ask technicians for assistance.

  • How can I activate images on the DVD in video file so that I can edit and send to people?

    Hello.  I recently transferred footage tape VCR to a gathering on a DVD of family.  How can I activate images on the DVD in video file so that I can edit and send to people?

    Any help would be appreciated, as I was chasing my tail for about an hour and a half now.

    Thank you!

    When you insert the DVD in your DVD player... close
    all the windows that can open and then go to... Start /.
    Computer... right click the icon for the DVD player
    is in, and then select or open Explorer.

    The files you need from the DVD are the. VOB files.
    You will find them in the VIDEO_TS folder. Copy them
    in a folder on your hard drive. Or you can copy the
    full VIDEO_TS folder.

    First... just try to rename one of the. VOB files to
    . MPG or. AVI and see if it will matter in Movie Maker.
    If import works... drag the file to the timeline and
    Economy/publication it to .wmv or .avi format. Then...
    Re - import new video film for editing purposes.
    (if you have Vista Home Premium or Ultimate, you)
    may be able to import the VOB files in Movie Maker
    as they are)

    (FWIW... you can probably play the files renamed
    in Windows Media Player to be sure that VOB
    file to edit)

    If you are unable to import the files they need to be converted
    another .wmv format would be a good choice.

    There are many programs that can do conversions...
    The following freeware is an example...:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Format Factory
    http://www.videohelp.com/tools/Format_Factory
    (the 'direct link' is faster)
    (the file you want to download is: > FFSetup260.zip<>
    (FWIW... installation..., you can uncheck
    ('all' boxes on the last screen)

    First, you will need to decompress the file or just open the
    Drag FFSetup260.exe out of the folder
    and drop it on your desktop. To install left click.

    Next, after the download and installation of Format
    Factory... you can open the program and
    left click on the toolbar, the "Option" button and
    "Select an output folder to" / apply / OK.
    (this is where you find your files after they)
    are converted)

    Drag and drop your video clips on the main screen...

    Select "all to WMV" / OK...

    Click on... Beginning... in the toolbar...

    That should do it...

    Good luck...

  • image on the screen grows, don't see the Start button

    G5200uk-m, nvidia display computer

    image on the screen grows, don't see the Start button

    I hope it works for you. Let us know how it goes.

  • 2.4 ambient light: images on the screen with LR has more warm than the setting of the others...

    THE IMAGES ON THE SCREEN WITH LR2.4 HAS A TONE HOTTER THAN SETTING OTHER PHOTOEDITING INSTALLED ON THE SAME COMPUTER PROGRAMS. HOW CAN I CHANGE THE KEY IN LR2.4?

    In fact, it is a well known problem with Lightroom. It emerges from all the

    time on this forum for windows systems (others can testify of this fact and)

    must be the reason why John suggested recalibrate above). Some monitor

    profiles of this vessel from manufacturers (or that some packets of calibration

    generate) have intentions of corrupt perceptual rendering. If it is present,

    Lightroom uses the perceptual intent. Photoshop always uses the parent

    one. This can lead to differences between Lightroom and Photoshop. Sometimes

    These differences may be really obvious (as they are here) and sometimes it

    is just visible as a permanent slight Posterization or coloring in the shadow areas. The

    solution is to calibrate and profile using equipment, or if you care

    on the color and contrast of your images (hard to call you a photographer to)

    However pointing) your windows installation is simply to guess than sRGB

    for the monitor.

    Bottomline: When you see a difference between Lightroom and Photoshop for

    files with the same settings in LR and ACR, the cause is in 90% of cases

    a "bad" or inappropriate for

    Monitor profile in Lightroom and in 10% of the incorrect settings in the color

    tab management in Photoshop.

    Someone on this forum once noticed that if I had

    received a dime for all the moments that I suggested that the monitor profile

    has been bad and the poster came up saying "but that may not be true."

    to discover after much insistence to calibrate / profile in fact the

    show that he has the profile, I'd be rich. Of course, I can't count

    the number of times that this has proved to be the case. In the end, I could be

    able to buy a beer for the income, but to become rich?

Maybe you are looking for

  • Install a video card GeForce nVidia on my desk of m7330n

    Dear community, First of all thank you if you help me . Finally, I have a HP Media Center PC m7330n with all the basic tricks included as 1 g RAM, windows XP, ATI Radeon X - 200 series Vid. Card. I really want to update my video card to play most of

  • hard drive is full

    my pc has 2 hard drives and 1 is full and the other is empty, and I don't know how to do for them?

  • How to stop desktop folder open in windows Explorer at startup?

    Whenever I start my laptop (windows 7) windows Explorer opens with the desktop folder.  I can't stop what's happening, and it drives me crazy (well there really difference, I just closed but it's just one of those things I can't stop annoying) Please

  • Nine-slice scaling works do not?

    Hello! I don't know what I'm doing wrong. But when I placed the slices nine images in the StackLayout they are not correctly set. (see attachment) I use 415 x 339 images and files *.amd: #RimCascadesAssetMetaData version = 1.0Source: "rect_passive.pn

  • TimesTen - 7001: user authentication failed when using XLA

    I installed TimesTen 11.2.1.8.0 on AIX 5.3 System.* user 'oracle '. I created another user of the application 'risk' to use in my application with TimesTen.When running my application with the user 'risk' to connect with TimesTen it is OK. But when I