Create a QImage bb::cascades:Image

Hi, how can we create a QImage from bb::cascades:Image or bb::cascades:ImageData?

Thank you

Sorry to bring this element thead dead to life, but you can easily extract data from bb::ImageData using bb::utility:ImageConverter :

bb::ImageData imageData; // our source imageDataQByteArray encoded = bb::utility::ImageConverter::encode("image/bmp", imageData);QImage image; // destination QImage

if (image.loadFromData(encoded, "BMP")) { // load QImage from encoded QByteArray as BMP streamQImage scaledImage = image.scaled(720, 720, Qt::KeepAspectRatio); // if we wish to scale source image    scaledImage.save("sample.png", "PNG"); // if we wish to save scaled image}

Tags: BlackBerry Developers

Similar Questions

  • ImageView is not showing any transparency since QImage converted to bb::cascades:Image

    Hi all

    I always try to create an overlay to the mapView. I'm now trying to use a standard QImage QPainter solution, then converting the QImage I called a bb::cascade:Image. But for some reason, the ImageView still has a white background, even when the Image I give all its alpha set to 0 pixel values.

    NVM solved, I'm stupid. It's that the I had the container root of my set of custom controls to the disposal of the battery... (aka no overlap) so it would draw on transparency for nothing and he appeared as white.

  • Why "save under" create a folder separated for images when the page is saved.

    for example, when you save the ezpass document he used to save the page. now, it saves the page more creates a folder that contains images. I can't delete the folder without leaving the page. My mistake, it would be using Firefox.

    now in support of Firefox.

    But to answer your question, HTML is a markup language that displays images files etc. Unlike a document of treatment of all the elements of the document included in a single file. HTML stores the items of the page as individual items. If a folder is created to hold these items such as images, files audio video flash etc..

    Microsoft encouraged a MHTML file format they have invented and placed in Internet explorer, which is a single file of storage, but it is really only supported in Internet Explorer.

    It seem not to be modules on the site of the add-on to enable MHTML in firefox such as

    https://addons.Mozilla.org/firefox/addon/Mozilla-archive-format/?src=search

    https://addons.Mozilla.org/firefox/addon/UnMHT/?src=search

    If you have had this feature before, perhaps you have already installed an add-on?

  • How to create several classes of cascade?

    Goal: Create the button to start and stop the service.

    Situation: One button works.

    However, whenever I click on another button, the button does not work.

    Question: how to create several classes of cascade?

    or something wrong in my code?

    Mini code:

    Calls a CPP QML.

    ApplicationUI::ApplicationUI (bb::cascades:Application * app): QObject (app)

    {
    QmlDocument * qml = QmlDocument::create("asset:///main.qml").parent(this);

    CameraWrapper * wrapper = new CameraWrapper();

    QML-> setContextProperty ('wrapper', wrapper);

    AbstractPane * root = qml->() createRootObject;
    App-> setScene (root);
    }

    And then, QML calls another RPC.

    import bb.cascades 1.0

    {Page}
    {Of container
    layout: {DockLayout}
    }
    Button {}
    text: qsTr ("Start")
    onClicked: {}
    wrapper.startRec ();
    }
    }
    Button {}
    text: qsTr ("Stop")
    onClicked: {}
    wrapper.stopRec ();
    }
    }
    }
    }

    The main CPP:

    #include "cam.hpp".

    using namespace bb::cascades;

    {CameraWrapper::CameraWrapper()}

    int CameraWrapper::startRec() {}

    This button works.

    }

    int CameraWrapper::stopRec() {}

    This button does not work.

    }

    The main.hpp

    Class CameraWrapper: public QObject
    {
    Q_OBJECT
    public:
    CameraWrapper();
    Virtual ~ CameraWrapper() {}

    Q_INVOKABLE
    int startRec();
    int stopRec();
    };

    Thank you for your attention,

    Finally, we use the thread to solve the problem.

    Solution:

    loopWrapper (void * test) {void *}
    CameraWrapper * a = (CameraWrapper *) test;
    a-> startRec();
    return null;
    }

    setFlagWrapper (void * test) {void *}
    CameraWrapper * b = (CameraWrapper *) test;
    b-> setFlagFalse)
    return null;
    }

    void * CameraWrapper::setFlagFalse (void * arg) {}
    exit_application = false;
    fprintf (stderr, "Flag changed to false\n");
    return arg;
    }

    void CameraWrapper::runLoop() {}
    pthread_create (& thread_a, NULL, & loopWrapper, (void *) this);
    }

    void CameraWrapper::runSetFlag() {}
    pthread_create (& thread_b, NULL, & setFlagWrapper, (void *) this);

  • creating a Windows 7 .iso image

    I want to create a Windows 7 .iso image, so I can load it on a USB key.  I have Windows 7 currently on my computer, I have the Windows 7 upgrade disk that I bought at retail.  If I had downloaded Windows 7 from the Microsoft Store I could have downloaded the iso file - is it possible now to create this iso file or my drive upgrade or my Windows 7 system load?

    One of the things that the OP asked was an iso of the loaded image.

    I him have not tried, but if I plug my USB flash drive before you begin to "Create a system image", is one of the options shown in the drop-down list as to where I can save the iso.

    But when you make a Windows 7 system image it does not create an ISO file. ISO is an image of a CD or DVD and not the same thing as a system. While both use the word 'image', they are very different.

    To make a bootable flash drive to install Windows 7, which is what he wants, you must copy the installation DVD.

    Copy/imaging system installed will not work, but it allows you to restore Windows 7 in its current state instead of install Windows 7.

    Questions about installing Windows 7?
    FAQ - Frequently Asked Questions from Installation Windows 7 & responses

  • Why do they play the widesceen films etched to create dvd windows in narrow image mode

    Why do they play the widesceen films etched to create dvd windows in narrow image mode

    Why do they play the widesceen films etched to create dvd windows in narrow image mode

    ==========================================
    A few thoughts... good luck...

    It might be useful if you set DVD Maker 16:9 before you import
    the source files. If this does not help... you could try to prepare the
    project in Windows Live Movie Maker (choice of widescreen).

    The aspect ratio seems to work in creation of DVD so better the
    video source is in the. WMV format.

    The following article might be worth a visit:

    Windows 7 - Windows DVD Maker Widescreen Workaround
    http://www.pcmech.com/article/Windows-DVD-Maker-widescreen-workaround/

  • Create a rectangle with an image inside

    Hi all

    Issue of great starter... how to create a rectangle with an image inside.

    My project:

    -Create a dialog box where to put the name of the image.

    -create the link between the image to the active document (the photo is in the 'Links' folder)

    -make a rectangle in my document with an image inside.

    Think it all is ok except the last step (a start, I was spirit "which is the easier"... but no).

    Thank you very much and sorry for my English.

    to add a rectangle:

    var rect = doc.rectangles.add ();

    to place an image inside:

    Rect.place (file (image. Path));

  • I need to create combinations of text and images for the web. How to do this in elements or do I need Photoshop for this feature?

    I need to create combinations of text and images for the web. How to do this in elements or do I need Photoshop for this feature?  Please advise!

    slynn5236 wrote:

    I need to create combinations of text and images for the web. How to do this in elements or do I need Photoshop for this feature?  Please advise!

    You can do in PSE.

    1. Do the math to see how much space you'll need on your canvas to the image and text.
    2. Navigate to the file queue > new.blank. Enter the width & height, background color, resolution 72 px / in. It is your canvas, and in the layers palette will be the background layer.
    3. Copy and paste the image. It turns on a separate layer
    4. Activate the tool move, position the image and resize if necessary
    5. Activate the text tool, and then type your text. It will be on a separate so layer
    6. Position the text.
    7. Flatten layers and go to file > save for web. I'm usually on the long side about 800 px. Don't forget to check "constrain proportions". Adjust the quality slider to suit. You will probably want the type of JPEG file for web work.
  • How can I create a link to an image that is located on an ftp site to a Web page that is located on another.

    How can I create a link to an image that is located on an ftp site to a Web page that is located on another.

    I managed to do it with the full path of the link (file:///C|/Users/myname/Documents/familyK3/image1.jpg), but as it is quite long, I would use the relative path. To be clear, I have 1 site that spans 3 different storage locations for FTP. site1 (named familyK), that contains the page. On this page, I have an image that is in the images on training3 (named familyK3). I tried... / familyK3/images and... /... (/ familyK3/images, but I don't get to see the photo in DW (since it usually refers to an image in the same folder (root)) and not to another location).

    I use dreamweaver8.

    Stephaan

    Use an absolute URL in the field of the CBC to your properties panel.

    http://your_other_site.com/images/filename.jpg"alt ="description">

    Nancy O.

  • How can I create a link on an image?

    How can I create a link on an image?

    Select your image and in the tool of hyperlinks in the toolbar just type in the address of your site that you want to link. don't forget the http:// before the domain name.

  • create a theme of the image (after the site update)

    Hello

    How to create a theme of the image, in the new kuler window (after update of the site) then I want to know if I want to delete a comment in my theme, there is not any method to delete a comment in a Kuler.

    can someone help me...

    Thank you.

    Thanks for the Homeless of entry.  There are many features Kuler users have requested.  The function 'delete comment' is a good idea.  However, the main focus finalizes now the function 'create image '.

  • create a table of jpg images

    Hello. I want to create a table of jpg images and wrap them in an arrayCollection collection that will serve as the dataprovider of a TileList component...

    the images are located in an 'active' folder in the folder... tried src tags actionscript and mx and do not find how to create a table of images.

    thanx.

    You must use ItemRenderers to display images in list based controls.

    Here is an example in mxml


           
               
                   
                       
                       
                       
                   

               

           

           
               
                   
               

           

       

    This livedocs page

    http://livedocs.Adobe.com/Flex/3/HTML/Help.HTML?content=cellrenderer_8.html

  • Is there a way to create a TINY for B2G image, similar to TINY_ANDROID?

    Hi, is it possible to create a TINY of Firefox OS image similar to that of the TINY ANDROID image which is used for the development of the kernel. Android gives the ability to create with the BUILD_TINY_ANDROID flag, I wanted to know if there is anything similar in Firefox OS.

    If there is no support B2G, can still create us in a?

    Any suggestions would be very helpful.

    Thank you

    Thank you Tanner, has had a discussion with the developers b2g and found that there is not as a result support for the creation of the TINY for Firefox OS image. But the other thing is that they have the same kernel build system like Android, it should be pretty much the same thing with some kernel patches that might prove necessary.

  • Re: Satellite L300-1BV - create your recovery disc ISO images

    I wondered about this.
    Could make my recovery disc ISO images, I know I could just make a few extra copies, but I am learning to create ISO images.
    But I was a little worried about what would happen when I put a disc in the drive...

    This along with the recovery image is a bit complicated, and something like this is not possible.
    All you can do is create recovery DVDs using Toshiba recovery disc creator or directly start the HARD drive recovery using recovery Toshiba (F8) option.

    You can do with it what you want but how you want to start the installation later?
    Sorry, but I think that it will not work.

  • How to create the recovery disk from image on another laptop?

    Hi guys,.

    I have a laptop where the recovery partition was reformatted somehow.
    Although I used partition recovery software to recover the original partition, the original system partition containing the Creator program of recovery was also missing.

    I was wondering if just, is it possible to create a recovery disc install creator on another computer Toshiba Recovery disk, extract the image from recovery partition and then create image recovery disc?

    See you soon

    Hello

    Unfortunately, I have to disappoint you. It is not possible.

    I had the same situation after partitioning my hard disk, he disappeared and did not make a recovery disk.
    You can order the new silver recovery disk:
    https://backupmedia.Toshiba.EU/landing.aspx

    or get a copy of Windows and install it. Then, download all the required drivers and enjoy.

Maybe you are looking for