ImageView - cascades noob question

Please bare with me, as I am new to QT & waterfalls and try to learn by hacking up a small application...

The Dev Alpha is missing in a photo viewer, so it seemed an obvious candidate for a first application.

I managed to read the file system and the list of all the images in the camera directory, however... I can't display images of big camera like an ImageView (small, no camera images/screenshots show correctly).  The debugger displays this error in the console:

"ERR: Image ' / sdcard/DCIM/Camera/IMG_00000001.jpg' size of texture 1836 x 3264 exceeds application GL max 2048."

It was created through:

ImageView * image = ImageView::create("'/sdcard/DCIM/Camera/IMG_00000001.jpg").preferredSize(300,300);

The 300 x 300 size favorite does not seem to help - I guess it's a scale after once the image is already copied into memory.  Is there a recommended method for pre scale the Image before passing in ImageView, or another method recommended to treat this type of situation?

Thanks for your help.

Hello

There is a limit to the size of the images that can be processed by this call: 2048. For the images above it, you can do the following...

Citing one of the experts:

"

You can download the image manually from the file to a QImage (http://qt-project.org/doc/qt-4.8/QImage.html), and then resize the image before asking the buffers of the pixel to set on the ImageView (https://bdsc.webapps.blackberry.com/cascades/reference/bb__cascades__ImageView.html).

QImage previewImage; if(previewImage.load("filename")){     //Scale to fill the screen to allow peek preview     previewImage.scaled(size,Qt::KeepAspectRatio);     QByteArray previewImageByteArray((const char*)previewImage.bits(), imageSize); }

"
Feel free to ask for more information/help.

Tags: BlackBerry Developers

Similar Questions

  • Noob question: Playbooks all have the same performance?

    I know... noob question. I am to complete my first game PlayBook and before I submit the app store I wanted to make sure that hardware performance will be the same on all the playbook or will it be something because of the performance issues on a per-device basis? I hope that this will be similar to a console where you can expect stable performance. THX.

    All devices (currently) work the same in the same conditions.

    That does not mean, however, that you can treat it as a console.  A console runs only a game and nothing else (in general).

    The PlayBook can run multiple applications, and among other things, a user can 'Behavior of the Application' setting configuration Mode Showcase, default, or standby, what determines if your application runs or stops when it is idle.  If they are in window mode, they may have other things at the same time.

    To a first approximation, however, "even in the world" is probably correct, for now.  Don't forget there will be different tablets in the future, with specification different but compatible with your app... not quite like a console there where many games is basically orphaned (or requires a port) when a new generation comes out.

  • Noob question: autonomous AIR .bar files?

    Sorry for the noob question, yet to learn these things from the air. When we create a .bar file, it is the only file position, does it include the runtime air, flash, etc, etc, or is it always require an accumulation of air / flash runtimes on the device? THX.

    The .bar file does not include the time of execution because the runtime is already preinstalled on the Playbook.

    Air is really integrated into the PlayBook so you don see the difference between a native app or an Air application.

  • NooB question: Cup titles and a schedule of transfer

    Let's say I have tons of tracks.  In the Middle, I find I want to firm up a few seconds of footage.  I can cut, or delete the clip, but I still have to select all the following clips and make sure they move upward.  There must be a smarter way of removing a few seconds of footage and moving upward?

    Sorry for the noob question, I searched on google and didn't know what to look for.  I am open for more information that can help me to tighten my research thus.  See you soon.

    The answer will probably depend on more factors:

    Are there in your Timeline, Clips above the area of the Clip you want to Trim?

    What you want to happen to those?

    Are you only concerned to "strengthen" the Clips on the same video track where you cut, or Clips on other tracks video too?

    It is likely that the tool Edit Ripple, or Rt-click and Ripple delete, will do what you want, but who can count on the other Clips on other tracks, and video that you need.

    Good luck and please let us know a little more.

    Hunt

  • D.I. box noob question

    Hi all

    Sorry for the noob question, but I need something clear up if possible. I was about to buy a box for injection and then had a query on them, and if I actually could benefit in this scenario...


    Fig 1. is how I currently record.

    Fig 2. is how I would do it with di direct box

    diag.jpg

    My question is... in this configuration, the d.i. box would make a difference to the signal? or he would only make a difference if I was going to live guitar to box, the sound card?

    Thank you for all your help.

    In my opinion you have basically three alternatives for the recording of the guitar:

    1. get an amp excellent sound, recording with a microphone, or more, in a room of good survey.

    Challenges: you'll probably need a studio proper, or at least no neighbours, because it could become LOUD. It takes time and experience of mike a good amp and even microphones expensive (several). Result depends on the acoustics of the room more than you think.

    Another way here, is to get/build an isolation area around your amp, which will be a kind of micro studio for it, allowing you to play hard and with a good tone, but in a more controlled environment. Many advantages for this make. Unfortunately, the expense can also be 'pro' - but I don't know there are DIY solutions.

    2. record of the amp 'dry' via either its line (send FX will also) or use a ' soaking power allowing you to put the amp (some sounds so much better AMPS), but with a low volume in the room. You can connect the device of soaking directly, or give the speaker the "tame" signal and mike the amp without disturbing the neighbors that it now. Good power soaks don't come cheap (?). Dry recording, for example by not using mike, often sounds like this: dry. It depends on your style of music, but an electric guitar should probably be considered an acoustic instrument. Instead of a diaphragm in wood, it has a speaker. The sound, often, we want to achieve is an amp of good sounding in a good room, which is an acoustic sound. You simply cannot get to an exit row or direct to a soaking of output power (not president). He needs treatment.

    3 use a program like GuitarRig, Amplitube etc. No installation required, regardless of the size of the room and acoustic sound (except that the acoustics of the room always will affect listening!) or mike. The software simulates the amps, effects and even mic configurations; added the "airplane" that you will not get a direct connection. Once again, according to your style. If I were Bill Frisell or Jim Hall, i.e. anyone with an as most of their music very "naked" guitar sound, I probably does (but these guys have access to the great engineers too...), but in a pop idom / mixed rock with other instruments and certainly to do demos, that's actually what I would recommend. Especially for us space challenged who have neighbors and an infinite time either. No, you will not look like 'all the world'; It's garbage in French - garbage out as always (many are disappointed by the present, but some are happy, it is always the case)

    All you need is a sound card with an instrument of entry. If you have a * good * sound card already who is not entered instrument, you can consider a DI box. Otherwise I'd say it's redundant.

  • Noob question, youtube

    Hi im a noob to photoshop etc, and has recently started a YouTube channel for downloading music.

    Ive seen several channels that resemble the type of this http:/// www.youtube.com/watch?v=Apc4XT8xUvghttps://www.youtube.com/watch?v=Apc4XT8xUvg

    Does anyone how to make a video like this with snowflakes etc. and what program to use?

    Sorry if this is the wrong forum to ask this question in.

    I'm guessing that Adobe After Effects (perhaps with a plug-in):

    Video effects, Visual effects software | Download the free trial version Adobe after effects CC

    Can pick up a quick getaway in the After Effects forum and see what they say here as well.

  • Totally new with noob questions

    OK so im totally new to developing with Flex. My company uses flex to create RIA that work to read and write with SalesForce CRM. I use the salesforce toolkit and have an understanding of how everything works great base. what im trying to do is take the data which are entered in a text box and who present for salesforce. Currently, the first name, name and phone number are in the code. have created text boxes, I don't know how to take the value that is entered in one and make that equal to the value of its corresponding field.

    like I said... total noob

    If you are in ActionScript. FirstName = firstName.text should be fine, but in MXML and sometimes in ActionScript, you may need this:

    VAC. FirstName = "{firstName.text}.

    If this post has answered your question or helped, please mark it as such.

  • understanding scale noob questions limited.

    I wanted to convert a whole range of-1000 and + 1000 to 0 and 255 how im a complete noob.

    Thank you.

    You add and multiply.  Add 1000 to get your shift to the right place.  You now have a range of 0 to 2000.  Now multiply by 255/2000 (I let you do the reduction).

  • Assistant of the output instrument always 0.0 without input series, where's the trigger? -Noob question

    Guys keep with me, I'm another PLCs and VB/C programmer, there are still the old paradigms of locking my head.

    See attached vi. After that I disconnected the entry in the series, the wizard exits still instrument 0,0 to its terminal at regular intervals about 1 hz. Now how does the wizard output always inst 0.0 without a trigger entry series? There must be a timer somewhere... but I searched everywhere there is no timer, including by opening the front panel of the wizard of the instrument. I watch the whole bulk of the loop and block VISA etc, there is no synchronization setting.

    So my question is, if there is no entry of series by using the instrument, which is the parameter object that triggers the instrument Wizard still out 0,0 at regular intervals? Where the object/setting?

    Thanks in advance

    Great big thank you! I can sleep tonight! Muahahahahahha!

  • EA4500 + ADSL router: networking noob question

    Then... I'm not sure of the right words to use, but this is the case I would appreciate the help. I tried to figure out how to survive myself, but I find it a little confusing - however, if you think I just need a networking 101 do not hesitate to send me to appropriate information sources (I've tried a few, as I say, but I have not yet found a place where my situation fits!).

    Quick back story: I have a cheap TalkTalk ADSl router (D-Link 3680) where the Wireless does not properly in the House. So I just got a DSL EA4500 router for better strength/speed/compliance wireless - you'll just have to forgive me for not having an ADSL router, which I realize may have been a simpler solution!

    First of all, I put the (D-Link of TalkTalk 3680) ADSL router in Bridge mode and got this and the EA4500 work together which was great as it goes. However, I would be hard...

    I have a tower PC and wish to receive wired ethernet network. While I know in the set - up above I can run a cable from the 3680 to the EA4500 and then another cable to the PC because the PC is closer to the telephone (with the ADSL router) Jack, physically it seems wiser, if I take the PC of the 3680 ethernet connection (along with a second cable 3680 to EA4500 connection for the wireless). It may or may not be relevant that the 3680 is a Fast Ethernet output, as is the network PC card (i.e. are not Gigabit).

    I don't know (a) whether the above configuration is possible and if yes, how, or (b) the question whether in terms of networking, it is best to cable to the EA4500 computer (even if this will create a longer path to the PC and the wiring more).

    Meaning, and if yes maybe someone could give me also a term for what I'm doing?

    Help gratefully received! Garreth

    3680 port LAN (bridge) => EA4500 Port WAN (router)-online PC peripherals and wireless

    It's the best configuration and nothing should be connected to the 3680 other than the EA4500.

    The physical location of the electronics is not important, unless you can not run cable or wireless signal is low.

  • Noob question

    Trying to follow the instructions here--> https://developer.blackberry.com/cascades/documentation/dev/integrating_cpp_qml/

    But when I add

    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(&app);

    I'll be back...

    Several markers on this line

    -"qml" was not declared in this scope

    'QmlDocument' was not declared in this

    scope of application

    'QmlDocument' is not a class or namespace

    You need the corresponding specifying for QmlDocument...

    #include // And perhaps this as wellusing namespace bb::cascades;
    
  • Problem referencing function children containers - noob question

    I'm trying to highlight a list item in a list view when the user switches it. I get an error, which suggests that my function is not my container. I tried a bunch of different ways to reference the container by, I can't seem to find the solution.

    Error: asset:///main.qml:114: ReferenceError: can't find variable: highlight

    It happens in my setHighlight function. QML is as follows:

    import bb.cascades 1.0
    
    NavigationPane {
        id: navigationPane
    
        // auto-delete any page when popped from the NavigationPane
        onPopTransitionEnded: page.destroy()
    
        Page {
    
            Container {
    
                onCreationCompleted: _btController.deviceListing.discover()
    
                ListView {
                    id: deviceList
    
                    dataModel: _btController.deviceListing.model
    
                    listItemComponents: [
                        ListItemComponent {
                            type: "listItem"
    
                            Container {
                                layout: DockLayout {
                                }
    
                                Container {
                                    id: highlight
                                    background: Color.Black
                                    opacity: 0.1
                                    horizontalAlignment: HorizontalAlignment.Fill
                                    verticalAlignment: VerticalAlignment.Fill
                                }
    
                                StandardListItem {
                                    title: ListItemData.deviceName
                                    description: ListItemData.deviceAddress
                                    status: ListItemData.deviceRSSI
                                }
                            }
                        }
                    ]
    
                    function setHighlight(highlighted) {
                        if (highlighted) {
                            highlight.opacity = 0.5;
                        } else {
                            highlight.opacity = 0.0;
                        }
                    }
    
                    onTriggered: {
                        deviceList.toggleSelection(indexPath);
                        setHighlight(ListItem.selected)
                    }
               }
            }
        }
    }
    

    Hello

    That you reference ListItem.selected in ListView {}, but there is no there.

    It is only available on the element root of ListItemComponent.

    Something like this should work (untested):

    ListItemComponent {
      type: "listItem"
      Container {
        id: rootItem
        layout: DockLayout {}
        Container {
          background: Color.Black
          opacity: rootItem.ListItem.selected ? 0.5 : 0.0
          horizontalAlignment: HorizontalAlignment.Fill
          verticalAlignment: VerticalAlignment.Fill
        }
        ...
    

    ...

    onTriggered: {
      deviceList.toggleSelection(indexPath);
    }
    

    Select the element is a special case, but if you need to update the properties other than the selection, do not reference ListItemComponents directly. There may be multiple instances of a component and they are not guaranteed to exist, so they cannot be referenced by id from outside. All changes must be made by dataModel. In components bind to dataModel values.

  • BlackBerry Smartphones an another Noob Question (re mp3)

    Can I buy MP3s from Amazon or somewhere like that and put them on my Blackberry?  I'm confused whether the BB has a mp3 player.  Probably a stupid question, but thanks.

    Hello!

    Here's a knockout who deals with BB-compatible media formats:

    http://www.BlackBerry.com/BTSC/search.do?cmd=displayKC&docType=kc&externalId=KB05482

    Indeed, the BB has a player - it should be the icon on your homescreen called "Media".

    See you soon!

  • Outsourced nOOb Question ID box

    Currently, we outsource our ID box, at a cost of $300 per month.

    The area ID is OpenBSD, which I know a little. My questions are, the price seems high, and what should I know to set up my own box IDS?

    TIA!

    You don't need to know much about the underlying instrument used effectively operating system the ID.

    The knowledge needed to use the ID are related to the treatment of the events of signatures, tuning the IDS in your environment and in response to significant events indicated by the sensor.

    A GUI is anchored in the ID that allows the Web in the sensor to manage. An event viewer is available for download for to look you at events like the sensor reports to them.

    In the city, I have work, demonstrate us the sensors every two weeks to our interested customers. You can contact your local Cisco Office and see if there will be demos in the coming months, you could attend to familiarize yourself with the device.

    Hope this helps,

    Peter

  • noobie question about 2 guest OS and virtual HARD disk 1

    I want to know if this is possible and what possible impact, it may cause, as appropriate.

    Set up:

    2 Guest OS in VMware, both using different drives virtual of course since you cannot use the same operating system file invited on multiple instances.

    Then I set up another virtual HARD drive, lets call it SharedMyDrive, and this HARD drive will contain all my data and programs.

    Can I do both guest OS use this SharedMyDrive? (Should be possible with the options of parameters allowing to add more hard drives) but then my question is; How are the data in this manipulated shared HARD drive?

    If I turn both the OS and both of them make changes in SharedMyDrive, it's just a matter of who makes changes that records everything first? It would cause windows errors such as messages "this file is already in use" if I try to delete a file on OS1, but its use in OS2?

    In order to use shared storage, you need an operating system that is aware of this and handle it correctly. ESXi is an example of such operating system. Access to the same storage operating system that cannot manage shared access causes data corruption.

    André

Maybe you are looking for