crash in bb::cascades:ImageView:setImage

no idea about this...

crush the info:

End of process 190877883 (mapview) code SIGSEGV = 1 fltno = 11 ip=797774ec(/base/usr/lib/libbbcascades.so.1@_ZN2bb8cascades9ImageView16resetImageSourceEv+0x137) mapaddr = 001774ec. REF = 00000010 = 1 bdslot

QML:

ImageView
{
ID: myImageView
objectName: "imageObj.
visible: false
scalingMethod: ScalingMethod.AspectFit
preferredHeight: 768
preferredWidth: 768
}

Button {}

...

onClicked:
{

mapViewTest.startGenMapImage ();
}

}

Code:

Sub MapViewDemo::startGenMapImage()
{

......

BB:latform::geo:GeoList gList = mapView-> mapData()-> defaultProvider()-> toGeoList();
BB::Cascades:maps:MapImageGenerator * pMapImgGen = new MapImageGenerator (viewpro, gList);

Connect (pMapImgGen, SIGNAL (finished(bb::cascades::maps::MapImageGenerator*)),
This, SLOT (imageIsReady(bb::cascades::maps::MapImageGenerator*)));)

pMapImgGen_-> start();

}

void MapViewDemo::imageIsReady (bb::cascades:maps:MapImageGenerator * pMapImgGen)
{
If (! pMapImgGen-> error())
{
BB::Cascades:image img (pMapImgGen-> imageData());
imgView_-> setImage (img);   crushed
imgView_-> setVisible (true);
}
on the other
{
qDebug() < "app::generate="" image="" error:"=""> < pmapimggen-=""> error();
}
delete pMapImgGen;

}

Check "img" and check if the imgView_ is a pointer valid.

Tags: BlackBerry Developers

Similar Questions

  • How to get a static Image location (Lon &amp; Lat)

    Hi, I have a location (long & Lat),

    How to get a static Image of these data?

    Thank you

    JAM373 blackberry jam europe reading

    and

    http://supportforums.BlackBerry.com/T5/native-development/crush-in-BB-Cascades-imageView-SetImage/m-...

    Found the solution using MapImageGenerator

    I am applying like this

    on .qml:

    function getImage() {
       mapImage.getImageMap(lat, lon, screenWidth);
    }
    
    attachedObjects: [
       StaticMapImage {
         id: mapImage
         onGetProperties: {
           staticMapImage.image = aPropertyMap.img;
         }
      }
    ]
    
    ImageView {
       id: staticMapImage
       preferredWidth: screenWidth
       preferredHeight: 300
    }
    

    on StaticMapImage.cpp:

    StaticMapImage::StaticMapImage(QObject *parent):
        QObject(parent)
        {
    
        }
    
    void StaticMapImage::getImageMap(const double &aLatitude, const double &aLongitude, int width)
        {
        ViewProperties mapProperties;
        mapProperties.setLatitude(aLatitude);
        mapProperties.setLongitude(aLongitude);
        QRect windowRect(0,0, width, 300);
        mapProperties.setWindow(windowRect);
    //  mapProperties.setAltitude(500);
    
        iMapImageGenerator = new MapImageGenerator(mapProperties);
        bool result = connect(iMapImageGenerator,
                SIGNAL(finished(bb::cascades::maps::MapImageGenerator *)),
                this, SLOT(imageFinished(bb::cascades::maps::MapImageGenerator *)));
        Q_ASSERT(result);
        Q_UNUSED(result);
    
        iMapImageGenerator->start();
        }
    
    void StaticMapImage::imageFinished(bb::cascades::maps::MapImageGenerator *aMapImageGenerator)
        {
        bb::cascades::Image img(aMapImageGenerator->imageData());
    
        QDeclarativePropertyMap* propertyMap = new QDeclarativePropertyMap;
        propertyMap->insert("img",  QVariant(QVariant::fromValue(img)));
        setProperties(propertyMap);
    
    //  delete iMapImageGenerator;
        }
    
    QDeclarativePropertyMap *StaticMapImage::properties()
        {
        return iPropertyMap;
        }
    
    void StaticMapImage::setProperties(QDeclarativePropertyMap *aPropertyMap)
        {
        iPropertyMap = aPropertyMap;
        emit getProperties(iPropertyMap);
        }
    

    on StaticMapImage.hpp:

    class StaticMapImage: public QObject
    {
        Q_OBJECT
        Q_PROPERTY(QDeclarativePropertyMap *properties READ properties WRITE setProperties NOTIFY getProperties)
    public:
        StaticMapImage(QObject *parent = 0);
        Q_INVOKABLE void getImageMap(const double &aLatitude, const double &aLongitude, int width);
    
    private slots:
        void imageFinished(bb::cascades::maps::MapImageGenerator *aMapImageGenerator);
    
    public slots:
        QDeclarativePropertyMap *properties();
        void setProperties(QDeclarativePropertyMap *aPropertyMap);
    
    signals:
        void getProperties(QObject *aPropertyMap);
    
    private:
        MapImageGenerator *iMapImageGenerator;
        QDeclarativePropertyMap *iPropertyMap;
    };
    

    Thank you

  • ImageView expected to auto-sense orientation

    A few comments to the people of the API:

    Shouldn't the ImageView read the EXIF of a JPEG image and automatic image rotation? And so by default, shouldn't there not a property such as 'autoOrient' or 'function' that this happens?

    Seen developers manually read the EXIF data, manually turn the images, etc., seems to be a waste of developer time.

    Follow-up question: if I do it manually and you end up with a QImage, how to recognize an ImageView to use a QImage? Is this possible?

    And one last question followed: what type is the property of 'image' of the ImageView?  He says it's a QVariant, but is not very useful.  Can we set this property, or is read-only?  Overall, I think that the "image" property documentation could use some improvements.

    Thank you

    Daniel

    Understood that through:

    http://supportforums.BlackBerry.com/T5/Cascades-development/rotation-and-translation-cuts-the-image/...

    ... my container was not big enough. I have change the container that has the ImageView to fill the page, and which prevented the cropping. I'm glad it was something simple.

    Here is a very rough code incase it is useful to someone else:

    #include 
    #include 
    #include 
    #include 
    
    ...
    
    // Gets called when the root container is resized, so that we can track
    // how large it is.
    void PhotosModel::updateContainerSize(qreal width, qreal height)
    {
        // Is this the initial call to updateContainerSize, or did
        // the size of the container change because of an orientation
        // change?
        bool initOrReInit = (containerWidth != (int)width);
    
        containerWidth = width;
        containerHeight = height;
    
        if (initOrReInit && imageLoadedFlag)
        {
            // When we tried to load this, we didn't yet know the width of the
            // screen. Now that we do, display the image.
            qDebug() << "Delayed image load";
            loadImage(photos.at(curPhoto).absoluteFilePath());
        }
    }
    
    void PhotosModel::loadImage(QString file)
    {
        imageLoadedFlag = true;
    
        // If the screen hasn't loaded yet and we don't know how wide
        // the container is, then hold off until we do.
        if (containerWidth == 0)
        {
            qDebug() << "Can't display image yet";
            return;
        }
    
        int width = -1;
        int height = -1;
        bool xyFlip = false;
    
        ExifLoader* loader = exif_loader_new();
        exif_loader_write_file(loader, file.toStdString().c_str());
        ExifData* data = exif_loader_get_data(loader);
    
        imageView->setRotationZ(0);
    
        int desiredRotation = 0;
    
        if (data != NULL)
        {
            //exif_data_dump(data);
    
            // Treating this as int* seems to result in corruption / bad behavior.
            // I think orientation is supposed to be a 'short int', which I would have
            // thought would be 2 bytes, but short int * doesn't seem to be consistent
            // either. So far char* seems to work.
            char* orientationPtr = (char *) GetExifValue(data, EXIF_TAG_ORIENTATION);
    
            if (orientationPtr != NULL)
            {
                //int orientation = *orientationPtr;
    
                int orientation = orientationPtr[0];
    
                // 1 -> OK
                // 3 -> Rotate 180
                // 6 -> CC 90
                // 8 -> C 90
    
                qDebug() << "Orientation: " << orientation;
    
                if (orientation == 3)
                {
                    desiredRotation = -180;
                }
                // NOTE: Also doing this for orientation == 0, because I have
                //       a photo with orientation 0 that seems to need this.
                //       Confused. Picasa seems to know that the image needs
                //       this rotation.
                else if (orientation == 6 || orientation == 0)
                {
                    desiredRotation = 90;
                    xyFlip = true;
                }
                else if (orientation == 8)
                {
                    desiredRotation = -90;
                    xyFlip = true;
                }
                else
                {
                    desiredRotation = 0;
                }
    
                //qDebug() << "Width: " << width << ", Height: " << height;
            }
    
            long* widthPtr = (long *) GetExifValue(data, EXIF_TAG_PIXEL_X_DIMENSION);
            if (widthPtr != NULL)
            {
                width = (int)*widthPtr;
            }
    
            long* heightPtr = (long *) GetExifValue(data, EXIF_TAG_PIXEL_Y_DIMENSION);
            if (heightPtr != NULL)
            {
                height = (int)*heightPtr;
            }
        }
    
        if (width == -1 || height == -1)
        {
            // Trouble. We don't know how large the photo is.
            // For now we'll just show nothing. Will this ever happen? How can we
            // fail more gracefully?
            imageView->setVisible(false);
            ErrorHelpers::showDialog("Missing EXIF Data", "The EXIF data for this image doesn't indicate its width/height, and so it cannot be displayed.");
        }
        else
        {
            imageView->setVisible(true);
        }
    
        int virtualContainerWidth;
        int virtualContainerHeight;
    
        if (xyFlip)
        {
            qDebug() << "xyFlip";
            virtualContainerWidth = containerHeight;
            virtualContainerHeight = containerWidth;
        }
        else
        {
            virtualContainerWidth = containerWidth;
            virtualContainerHeight = containerHeight;
        }
    
        qDebug() << "virtualContainerWidth: " << virtualContainerWidth;
        qDebug() << "virtualContainerHeight: " << virtualContainerHeight;
    
        float imageAspect = (float)width / (float)height;
    
        qDebug() << "imageAspect: " << imageAspect;
    
        float screenAspect = (float)virtualContainerWidth / (float)virtualContainerHeight;
    
        qDebug() << "screenAspect: " << screenAspect;
    
        int imageScreenWidth;
        int imageScreenHeight;
    
        if (imageAspect > screenAspect)
        {
            // Image is wider than screen aspect wise, so X will be limiting dimension.
            if (width > virtualContainerWidth)
            {
                imageScreenWidth = virtualContainerWidth;
            }
            else
            {
                imageScreenWidth = width;
            }
            // Better to round here?
            imageScreenHeight = (int)((float)imageScreenWidth / imageAspect);
    
            qDebug() << "Limited by X";
            qDebug() << "imageScreenWidth: " << imageScreenWidth;
            qDebug() << "imageScreenHeight: " << imageScreenHeight;
        }
        else
        {
            // Image is taller than screen aspect wise, to Y will be limiting dimension.
            if (height > virtualContainerHeight)
            {
                imageScreenHeight = virtualContainerHeight;
            }
            else
            {
                imageScreenHeight = height;
            }
            // Better to round here?
            imageScreenWidth = (int)((float)imageScreenHeight * imageAspect);
    
            qDebug() << "Limited by Y";
            qDebug() << "imageScreenWidth: " << imageScreenWidth;
            qDebug() << "imageScreenHeight: " << imageScreenHeight;
        }
    
        int imageX;
        int imageY;
        imageX = (int)((float)containerWidth / 2.0f - (float)imageScreenWidth / 2.0f);
        imageY = (int)((float)containerHeight / 2.0f - (float)imageScreenHeight / 2.0f);
    
        qDebug() << "imageX: " << imageX;
        qDebug() << "imageY: " << imageY;
    
        imageView->setPreferredWidth(imageScreenWidth);
        imageView->setPreferredHeight(imageScreenHeight);
    
        AbsoluteLayoutProperties* layoutProperties = new AbsoluteLayoutProperties();
    
        layoutProperties->setPositionX(imageX);
        layoutProperties->setPositionY(imageY);
    
        imageView->setLayoutProperties(layoutProperties);
    
        qDebug() << "desiredRotation: " << desiredRotation;
    
        imageView->setRotationZ(desiredRotation);
    
        imageView->setImage(QUrl("file://" + file));
    }
    
    void* PhotosModel::GetExifValue(ExifData* data, ExifTag tag)
    {
        for (int i = 0; i < EXIF_IFD_COUNT; i++)
        {
            ExifContent* content = data->ifd[i];
            ExifEntry* entry = exif_content_get_entry(content, tag);
            if (entry != NULL)
            {
                return entry->data;
            }
        }
    
        return NULL;
    }
    

    ... and some related QML...

    Page {
        Container {
            id: rootContainer
            objectName: "rootContainer"
            background: Color.Black;
            layout: DockLayout {
            }
            horizontalAlignment: HorizontalAlignment.Fill
            verticalAlignment: VerticalAlignment.Fill
    
            attachedObjects: [
                // This handler is tracking the layout frame of the button.
                LayoutUpdateHandler {
                    id: handler
                    onLayoutFrameChanged: {
                        photosModel.updateContainerSize(layoutFrame.width, layoutFrame.height);
                    }
                }
            ]
    
            Container {
                layout: AbsoluteLayout {}
                horizontalAlignment: HorizontalAlignment.Fill
                verticalAlignment: VerticalAlignment.Fill
    
                ImageView {
                    id: imageView
                    objectName: "imageView"
    
                    scalingMethod: ScalingMethod.Fill
    
                    //scalingMethod: ScalingMethod.AspectFit
    
                    preferredWidth: 1
                    preferredHeight: 1
    
                    layoutProperties: AbsoluteLayoutProperties {
                        positionX: 1
                        positionY: 1
                    }
    
                    // Tried this, but the image is still animating into place.
                    loadEffect: ImageViewLoadEffect.None
    
                    attachedObjects: [
                        ImplicitAnimationController {
                            enabled: false
                        }
                    ]
                }
            }
    

    It is an amount disappointing nonsense to be caused by the ImageView doesn't Autodetect not the EXIF orientation flag. Please improve this BlackBerry.

  • remove objects created dynamically ImageView

    I'm having a problem removing the ImageView objects I created during execution. I have an array of objects ImageView.

     bb::cascades::ImageView *m_imObj[20];
    

    I have then create and manipulate objects while executing.

    m_imObj[m_counter] = ImageView::create();
    

    I tried to remove the objects, but they continue to appear on the screen. What is the right way to eliminate an ImageVIew?

    SOLVED

    You must remove the object from its parent. In this case, the container, and then delete it.

    void IVControl::deleteStripeElement()
    {
        log("deleting stripe element " + QString::number(m_stripeCounter));
        m_stripesContainer->remove(m_stripes[m_stripeCounter]);
        delete m_stripes[m_stripeCounter];
        if (m_stripeCounter == 0) {
            disableDeleteButton();
        } else {
            m_stripeCounter--;
            enableAddButton();
        }
    }
    
  • Strange behavior of ListView

    Hello
    I use following code:

     ListView {       id: listView listItemComponents: ListItemComponent {           Container {               id: listItemContainer               property string packageId: ListItemData.packageId               property variant packageDetailsPage               layout: AbsoluteLayout { }               WebImageView               {                   preferredHeight: 290                   preferredWidth: 751                   url: ListItemData.url;              }          }     }
    

    code for WebImageView:

    webimageview. HPP

    #ifndef WEBIMAGEVIEW_H_
    #define WEBIMAGEVIEW_H_
    
    #include 
    #include 
    #include 
    #include 
    using namespace bb::cascades;
    
    class WebImageView: public bb::cascades::ImageView {
        Q_OBJECT
        Q_PROPERTY (QUrl url READ url WRITE setUrl NOTIFY urlChanged)
        Q_PROPERTY (float loading READ loading NOTIFY loadingChanged)
    
    public:
        WebImageView();
        const QUrl& url() const;
        double loading() const;
    
        public Q_SLOTS:
        void setUrl(const QUrl& url);
        void clearCache();
    
        private Q_SLOTS:
        void imageLoaded();
        void dowloadProgressed(qint64,qint64);
    
        signals:
        void urlChanged();
        void loadingChanged();
    
    private:
        static QNetworkAccessManager * mNetManager;
        static QNetworkDiskCache * mNetworkDiskCache;
        QUrl mUrl;
        float mLoading;
    
        bool isARedirectedUrl(QNetworkReply *reply);
        void setURLToRedirectedUrl(QNetworkReply *reply);
    };
    
    #endif /* WEBIMAGEVIEW_H_ */
    

    webimageview.cpp

    #include "WebImageView.h"
    #include 
    #include 
    //#include 
    #include 
    
    using namespace bb::cascades;
    
    QNetworkAccessManager * WebImageView::mNetManager = new QNetworkAccessManager();
    //QNetworkDiskCache * WebImageView::mNetworkDiskCache = new QNetworkDiskCache();
    
    WebImageView::WebImageView() {
        // Initialize network cache
        //mNetworkDiskCache->setCacheDirectory(QDesktopServices::storageLocation(QDesktopServices::CacheLocation));
    
        // Set cache in manager
        //mNetManager->setCache(mNetworkDiskCache);
    
        // Set defaults
    
        mLoading = 0;
    }
    
    const QUrl& WebImageView::url() const {
        return mUrl;
    }
    
    void WebImageView::setUrl(const QUrl& url) {
        // Variables
    
            mUrl = url;
            mLoading = 0;
            qDebug()<<"url:: "<get(request);
    
            // Connect to signals
            QObject::connect(reply, SIGNAL(finished()), this, SLOT(imageLoaded()));
            QObject::connect(reply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(dowloadProgressed(qint64,qint64)));
    
            emit urlChanged();
    
    }
    
    double WebImageView::loading() const {
        return mLoading;
    }
    
    void WebImageView::imageLoaded() {
        // Get reply
        QNetworkReply * reply = qobject_cast(sender());
        QObject::disconnect(reply, SIGNAL(finished()), this, SLOT(imageLoaded()));
        QObject::disconnect(reply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(dowloadProgressed(qint64,qint64)));
        if (reply->error() == QNetworkReply::NoError) {
            if (isARedirectedUrl(reply)) {
                setURLToRedirectedUrl(reply);
                return;
            } else {
                QByteArray imageData = reply->readAll();
                setImage(Image(imageData));
            }
        }
        // Memory management
        reply->deleteLater();
    }
    
    bool WebImageView::isARedirectedUrl(QNetworkReply *reply) {
        QUrl redirection = reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl();
        return !redirection.isEmpty();
    }
    
    void WebImageView::setURLToRedirectedUrl(QNetworkReply *reply) {
        QUrl redirectionUrl = reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl();
        QUrl baseUrl = reply->url();
        QUrl resolvedUrl = baseUrl.resolved(redirectionUrl);
    
        setUrl(resolvedUrl.toString());
    }
    
    void WebImageView::clearCache() {
        //mNetworkDiskCache->clear();
    }
    
    void WebImageView::dowloadProgressed(qint64 bytes, qint64 total) {
        mLoading = double(bytes) / double(total);
    
        emit loadingChanged();
    }
    

    I use ListDataModel. and code above works fine and the loading of the images. But when there are more than 100 items in a list it shows the bad images in some WebImageView. When you scroll through random images change. I checked the url property of webImageView to the point where bad image is loaded, but there the right url.

    in this connection, blackberry says that view list follows MVC architecture, and QObject belonged to ListView objects are deleted when scrolling out of the area visible to the element to which they belong, or when the ListView itself is deleted. What is the cause of my problem? If not, this what's wrong with this code? Help, please...

    nik005 wrote:

    @ekke Yes. If I scroll slowly, it works fine.

    THX.

    Then, it's the same reason.

    as soon as I have a small reproducible application to create a problem, I'll add this thread and let you know

  • Photos poorly oriented when pulled from filepicker

    In my application I allow users to take a photo or select an image using the filepicker.  But when she shows the images in an imageView that they appear on the side and never in the correct position, no matter if they were taken without focus lock, or whatever.  When I invoke the display of images, howeverm images are always perfectly oriented.

    Is there anything I can do in my code to accommodate for this?  Orientation is off differently isn't tlike it's always oritented left, sometimes it's to the right, sometimes it is upside down, sometimes it's to the left.

    Hello

    I know exactly what is happening - I'm working on an app photo from last year, and I had the same problem.

    When the camera takes a photo, it adds some EXIF metadata in the JPEG file that indicates its "focus".

    In my opinion, the BB should add an ImageView option such as "autoOrient" so that it would automatically read and the picture rotates as appropriate before posting, but I don't think such a property exists. Thus, all the developers who want to display pictures must add this logic to their App (inefficient or what?)

    The good news is that there is a sample application that shows how to do this.  Take a look at the sample application "photobomber.

    I'll copy and paste the relevant code here:

    QImage PhotoBomberApp::getRotateImage(const QString imageFilePath)
    {
        //Load the image using QImage.
        QImage image = QImage(imageFilePath);
    
        ExifData *exifData = 0;
        ExifEntry *exifEntry = 0;
        int exifOrientation = 1;
    
        // Since the image will loose its exif data when its opened in a QImage
        // it has to be manually rotated according to the exif orientation.
        exifData = exif_data_new_from_file(imageFilePath.toLatin1().data());
    
        // Locate the orientation exif information.
        if (exifData != NULL) {
            for (int i = 0; i < EXIF_IFD_COUNT; i++) {
                exifEntry = exif_content_get_entry(exifData->ifd[i], EXIF_TAG_ORIENTATION);
    
                // If the entry corresponds to the orientation it will be a non zero pointer.
                if (exifEntry) {
                    exifOrientation = exif_get_short(exifEntry->data, exif_data_get_byte_order(exifData));
                    break;
                }
            }
        }
    
        // A transform will be used to rotate the image according to device and exif orientation.
        QTransform transform;
    
        qDebug() << "Exif data:" << exifOrientation;
    
        // It's a bit tricky to get the correct orientation of the image. A combination of
        // the way the the device is oriented and what the actual exif data says has to be used
        // in order to rotate it in the correct way.
        switch(exifOrientation) {
            case 1:
                // 0 degree rotation
                break;
            case 3:
                // 180 degree rotation
                transform.rotate(180);
                break;
            case 6:
                // 90 degree rotation
                transform.rotate(90);
                break;
            case 8:
                // 270 degree rotation
                transform.rotate(270);
                break;
            default:
                // Other orientations are mirrored orientations, do nothing.
                break;
        }
    
        // Perform the rotation of the image before its saved.
        image = image.transformed(transform);
    
        return image;
    }
    

    This code returns you a QImage, so you can or may not know how, then take that and display them in an ImageView. Incase it's useful, here's an example of my application relating to this code:

    QImage thisQImage = getRotateImage(...);
    
    bb::ImageData imageData = bb::ImageData::fromPixels(thisQImage.rgbSwapped().bits(), bb::PixelFormat::RGBX, thisQImage.width(), thisQImage.height(), thisQImage.bytesPerLine());
    
    bb::cascades::Image cascadesImage = imageData;
    
    imageView->setImage(cascadesImage);
    

    A final caveat is that doing each of these conversions between types of image data takes a little time, and so if you do it in the main thread of the application, you might or might not slow down the user interface.  I tried to move my loading image in another thread when it is possible, although I found (I think) the conversion in bb::cascades:Image does not work correctly if this isn't in the main thread, so I don't have this part and call setImage in the main thread.

    Hope that helps. Here the answer was simpler.

  • Download Images dynamically

    Hello

    Is it possible to download images dynamically and add them to an ImageView?

    Ive got a listView withcustom ListItem elements, which are essentially an imageView and a label. After you have added the list on a page I would like images in a dynamic list and put them in the ImageViews of my custom components displayed on my listView.

    I already download the image and create a bb::cascades:Image (QByteArray). But I can't find a way to assign them to the custom my components in the ListView. I got this error in the console:

    Error: Access to ListItem.indexInSection on a node that is not the node root of a Visual list.

    Code of P.S.:any would be great!

    So I developed this class which will allow you to display the internet dynamically downded images without having to be stored in the unit:

    /*
     * RemoteImageView.h
     *
     *  Created on: Oct 2, 2012
     *      Author: aluialarid
     */
    
    #ifndef REMOTEIMAGEVIEW_H_
    #define REMOTEIMAGEVIEW_H_
    
    #include 
    #include 
    #include 
    #include 
    #include 
    
    namespace bb {
        namespace cascades {
            class Container;
        }
    }
    using namespace bb::cascades;
    
    class RemoteImageView: public CustomControl {
        Q_OBJECT
        Q_PROPERTY(QString url READ URL WRITE seturl NOTIFY urlChanged)
    
    public:
        RemoteImageView(Container *parent=0);
        virtual ~RemoteImageView();
        Container* mRootContainer;
        ImageView* imageView;
        Q_INVOKABLE void loadImage();
        void seturl(QString url);
        QString URL();
    
    public  slots:
        void onImageLoaded(QNetworkReply* reply);
        void onurlChanged();
        signals:
                void imageUnavailable();
                void urlChanged(QString url);
    
    private:
        QString murl;
    
    };
    
    #endif /* REMOTEIMAGEVIEW_H_ */
    
    /*
     * RemoteImageView.cpp
     *
     *  Created on: Oct 2, 2012
     *      Author: aluialarid
     */
    
    #include "RemoteImageView.h"
    #include 
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    
    RemoteImageView::RemoteImageView(Container *parent) :
            CustomControl(parent) {
        //Q_UNUSED(parent);
        mRootContainer = new Container();
        mRootContainer->setLayout(new DockLayout);
        imageView = ImageView::create().image(
                QUrl("asset:///images/defaultarticlelist.png")).horizontal(
                HorizontalAlignment::Center).vertical(VerticalAlignment::Center);
        imageView->setScalingMethod(bb::cascades::ScalingMethod::AspectFit);
        mRootContainer->add(imageView);
        setRoot(mRootContainer);
        connect(this, SIGNAL(urlChanged(QString)), this, SLOT(onurlChanged()));
        //  connect(mRootContainer->layout(), SIGNAL(CreationCompleted()), this, SLOT(onurlChanged()));
    
    }
    
    RemoteImageView::~RemoteImageView() {
        //delete mRootContainer;
    }
    
    void RemoteImageView::loadImage() {
        qDebug() << murl;
        QNetworkRequest request = QNetworkRequest();
        request.setUrl(QUrl(murl));
        QNetworkAccessManager* nam = new QNetworkAccessManager(this);
        bool result = connect(nam, SIGNAL(finished(QNetworkReply*)), this,
                SLOT(onImageLoaded(QNetworkReply*)));
        Q_ASSERT(result);
        Q_UNUSED(result);
    
        nam->get(request);
    }
    void RemoteImageView::onurlChanged() {
        loadImage();
    
    }
    void RemoteImageView::onImageLoaded(QNetworkReply* reply) {
        if (reply->error() != QNetworkReply::NoError) {
            emit imageUnavailable();
            return;
        }
        Image image = Image(reply->readAll());
        imageView->setImage(image);
    
    }
    void RemoteImageView::seturl(QString url) {
        if (murl.compare(url) != 0) {
            murl = url;
            emit urlChanged(murl);
        }
    }
    QString RemoteImageView::URL() {
        return murl;
    }
    

    See you soon!

  • BB::imagedata memory leak

    I have a class which, given to a QImage, done:

    bbImageData = bb::ImageData :: fromPixels (qimage.rgbSwapped () .bits (), bb:ixelFormat::RGBX, qimage.width (), qimage.height (), qimage.bytesPerLine ());

    This memory leak, even if bbImageData is a class member variable that is not a pointer, and so I would have thought could get automatically cleaned.

    What should I do to release the memory it takes?

    I think I was wrong and what was actually leaking memory was when I was doing:

    cascadesImage = bbImageData;

    imageView-> setImage (cascadesImage);

    (where cascadesImage is defined in the file .h as bb::cascades:Image)

    It seems as if I can do:

    cascadesImage = bb::cascades::Image();

    imageView-> setImage (cascadesImage);

    ... it releases memory.

  • Binding a list with QImage &amp; PixelBuffer data display view Image

    Hello

    I need to develop a photo gallary as application. I need to load images different lists of grid.

    I can paint pictures on a single ImageView using PixelBufferData.

    PixelBufferData pixelBuffer = PixelBufferData(PixelBufferData::RGBX, width, height, width, qimage.bits());
    
        Image image = Image(pixelBuffer);
        imageView->setImage(image);
    

    Now, I need to tie this with a list of grid view. How to get specific ListItem Image view painting.

    ListView { id: albumsListView objectName: "albumsListView" layout: GridListLayout { columnCount: 5 }
    
    dataModel: XmlDataModel { source: "models/album.xml" }
    
     listItemComponents: [ ListItemComponent { type: "album" MyListItem { } } ]
     
    

    MyListItem is a custom component:

    Container { id: myItemContainer layout: DockLayout { } Container { layoutProperties: DockLayoutProperties { horizontalAlignment: HorizontalAlignment.Fill verticalAlignment: VerticalAlignment.Fill } layout: DockLayout { } ImageView { id: coverImageView objectName: "coverImageView" imageSource: ListItemData.coverImage preferredWidth: 250 preferredHeight: 250 } Container { background: Color.Black opacity: 0.7 layout: DockLayout { } layoutProperties: DockLayoutProperties { horizontalAlignment: HorizontalAlignment.Fill verticalAlignment: VerticalAlignment.Bottom } Label { text: ListItemData.name layoutProperties: DockLayoutProperties { horizontalAlignment: HorizontalAlignment.Center verticalAlignment: VerticalAlignment.Bottom } textStyle { base: SystemDefaults.TextStyles.BodyText fontWeight: FontWeight.Bold color: Color.White } } } }}
     
    

    I tried to call the method onCreationComplete of imageView & ImageView onImageSourceChanged but did not work.

    Well, I managed to find the solution.

    I used just custom ListItemManager & ListItemListener update display image in list & it worked fine.

    You can see below the links for more information. Documentaion is quite good. Its very easy to understand & implement.

    https://developer.BlackBerry.com/Cascades/reference/bb__cascades__listitemmanager.html

    https://developer.BlackBerry.com/Cascades/reference/bb__cascades__listitemlistener.html

    Sorry to bother you.

    Nishant Shah

  • QNetworkAccessManager finished signal never happens

        static QNetworkAccessManager* netManager = new QNetworkAccessManager();
        if (netManager) {
            QUrl url("http://some.url:8080/image.png");
            QNetworkRequest networkRequest(url);
            this->connect(netManager, SIGNAL(finished()), this, SLOT(onReply()));
            QNetworkReply* networkReply = netManager->get(networkRequest);
        }
    

    the onReply() method is:

    void MyAppClassExtendsQObject::onReply(QNetworkReply* reply) {
        if (reply->error() != QNetworkReply::NoError) {
            qDebug() << "Image not available or any error";
            return;
        }
        Image image = Image(reply->readAll());
        ImageView* imageView = Glue::i()->getRoot()->findChild("id_media");
        if (imageView) {
            imageView->setImage(image);
        }
    }
    

    onReply never gets called, however this code used to work as it is in one of my previous versions of an application. What's not here?

    THX!

    You could paste the header file?

    Make sure that the slot is declared in "slots: ' section and line Q_OBJECT is not included in the class definition. The class must inherit from QObject or its descendants.

    Add some logging inside the if {} after a call to the connect() to make sure that this branch has been called.

    Try to replace the connect() with QObject::connect()

  • Signals and Slots

    Try to test something after that someone wanted to help with the signals and Slots sorta. I know there is an alternative to this, but I'm trying to understand why this does not work when doing it this way.  It relies, it works but it does not fly... I mean this isn't the trigger of the SLOT feature... Not even sure if she sends a SIGNAL...

    Thanks in advance.

    file:

    // Default empty project template
    #ifndef Testme_HPP_
    #define Testme_HPP_
    
    #include 
    
    namespace bb { namespace cascades { class Application; }}
    namespace bb { namespace cascades { class TouchEvent; }}
    namespace bb { namespace cascades { class Container; }}
    namespace bb { namespace cascades { class ImageView; }}
    
    /*!
     * @brief Application pane object
     *
     *Use this object to create and init app UI, to create context objects, to register the new meta types etc.
     */
    class Testme : public QObject
    {
        Q_OBJECT
    public:
        Testme(bb::cascades::Application *app);
        virtual ~Testme() {}
    public slots:
        void handleTouch(bb::cascades::TouchEvent* tEvent);
    private:
        bb::cascades::Container* rootContainer;
        bb::cascades::ImageView* imgView;
    };
    
    #endif /* Testme_HPP_ */
    

    .cpp file:

    // Default empty project template
    #include "Testme.hpp"
    
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    
    Testme::Testme(bb::cascades::Application *app)
    : QObject(app)
    {
        // create scene document from main.qml asset
        // set parent to created document to ensure it exists for the whole application lifetime
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
        QmlDocument *qml2 = QmlDocument::create("asset:///Testingme.qml").parent(this);
    
        // create root object for the UI
        AbstractPane *root = qml->createRootObject();
        // set created root object as a scene
        app->setScene(root);
    
        if (!qml2->hasErrors()) {
            rootContainer = qml2->createRootObject();
    
            if (rootContainer) {
                imgView = rootContainer->findChild("imgView");
    
                if (imgView) {
                    bool res = QObject::connect(imgView,                                        SIGNAL(touch(bb::cascades::TouchEvent*)),
                            this, SLOT(handleTouch(bb::cascades::TouchEvent*)));
                    Q_ASSERT(res);
                    Q_UNUSED(res);
                    fprintf(stderr, "Height: %f and width: %f\n",
                            imgView->preferredHeight(),                                        imgView->preferredWidth());
                } else {
                    fprintf(stderr, "No ImageView\n");
                }
            } else {
                fprintf(stderr, "No root container\n");
            }
        } else {
            fprintf(stderr, "QML2 has errors\n");
        }
    }
    
    void Testme::handleTouch(TouchEvent *tEvent)
    {
        fprintf(stderr, "Touch Touch Touch\n");
    }
    

    hand file. QML:

    // Default empty project template
    import bb.cascades 1.0
    
    // creates one page with a label
    Page {
        Container {
            layout: StackLayout {}
            Label {
                text: qsTr("Hello World")
            }
    
            Testingme {
                id: testingMe
            }
        }
    }
    

    File Testingme.QML:

    import bb.cascades 1.0
    
    Container {
        objectName: "rootContainer"
        horizontalAlignment: HorizontalAlignment.Center
        verticalAlignment: VerticalAlignment.Center
        background: Color.create ("#262626")
    
        ImageView {
            objectName: "imgView"
            imageSource: "asset:///belligerent.png"
            preferredHeight: 200
            preferredWidth: 200
        }
    }
    

    The main file is the one you get when you create a new project of Cascades Standard default. So, what's wrong with this picture? Or of images, other than the fact that I use the png of bellicose blocks file...

    -Edit (this and some formatting).

    I'm using the Simulator, so don't know if it would make a difference. BTW, I even tried to use a checkbox, and which does not trigger anything.

    Well, it works eventually got. I'm still not sure where to check signals during debugging, however.

    Although there are two files QML, the first main QML object is one that should be used. I used the 2nd QML file object that was wrong, even if the image is in the 2nd...

  • Expose the abstract as Q_PROPERTY to QML type

    Hello

    I defined a base class to implement interface:

    class AbstractImageProcessor : public QObject
    {
    public:
        AbstractImageProcessor(QObject * parent) : QObject(parent) {}
        virtual QImage process(const QByteArray &data) = 0;
        virtual ~AbstractImageProcessor(){ }
    };
    

    Such implementation that I want from QML looks like this:

    class WebImageProcessor : public AbstractImageProcessor
    {
        Q_OBJECT
        Q_PROPERTY(int maxHeight READ getMaxHeight WRITE setMaxHeight NOTIFY maxHeightChanged)
        Q_PROPERTY(int maxWidth READ getMaxWidth WRITE setMaxWidth NOTIFY maxWidthChanged)
        Q_PROPERTY(bool fit READ isFit NOTIFY fitChanged)
        public WebImageProcessor(QObject * parent = 0) : AbstractImageProcessor(parent) {}
        virtual ~WebImageProcessor() {}
        /* rest of code omitted */
    };
    

    I want to expose this AbstractImageProcessor as one property on another type QML:

    class WebImageView : public bb::cascades::ImageView {
        Q_OBJECT
        Q_PROPERTY(AbstractImageProcessor* processor READ getProcessor WRITE setProcessor NOTIFY processorChanged)
        WebImageView(bb::cascades::Container * parent) : bb::cascades::ImageView(parent)  {}
        virtual WebImageView() {}
        /* rest of code omitted */
    };
    

    So I save my custom with QML types

    //application.cpp
    qmlRegisterUncreatableType("foo.controls", 1, 0, "AbstractImageProcessor", ""); qmlRegisterType("foo.controls", 1, 0, "WebImageProcessor");
    qmlRegisterType("foo.controls", 1, 0, "WebImageView");
    

    How I want to use it in QML

    //main.qml
    import foo.controls 1.0
    /* omitted containers */
    
    WebImageView {
      processor: WebImageProcessor {
         maxHeight: 500
         maxWidth: 300
      }
      /* rest of properties omitted */
    }
    

    But once I launch my request, that he fails to analyze the document qml.

    BB::Cascades:QmlDocument: error loading QML of: QUrl ("asset:///main.qml")
    -errors: (asset:///main.qml:138:57: impossible to assign to the property object) bb::cascades:QmlDocument:createRootObject document is not loaded or has errors, cannot create the root

    In fact, if I hover over the WebImageProcessor class in the editor, he says:

    The super type of the WebImageProcessor component is unknown, some of its properties are not validated.

    Now, the thing is that the example cascades built in ListView exposes a type abstract as a Q_PROPERTY:

    http://developer.BlackBerry.com/native/reference/Cascades/bb_cascades_listview.html#property-datamod...

    Event inspect bb::cascades and bb::cascades:ListView header files:ataModel gives me no other indices because he did essentially the same way.

    I save the types in a different way? If so, how?

    If I use WebImageProcessor in the Q_PROPERTY instead of the AbstractImageProcessor then it works as expected, but I want to expose the abstract type, and as waterfalls is a then it is certainly possible somehow

    Turns out that I've been away an inside AbstractImageProcessor Q_OBJECT macro.

    I swear that I got before with no luck. Perhaps the project today solved the problem of cleaning.

    In any case, it works the way I wanted, with the only exception that Momentics complains about the assignment in qml, but this is just a minor inconvenience.

  • Custom control does not?

    I tried to implement a custom for my application control, but it does not phase is...

    Help, please...

    /*
     * ImageSlider.cpp
     *
     *  Created on: Jun 10, 2013
     *      Author: lalthomas
     */
    
    #include "ImageSlider.h"
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    
    ImageSlider::ImageSlider (Container *parent)
    : CustomControl(parent)
    {
        m_Container = new Container();
        m_Container->setLayout(new AbsoluteLayout());
    
        Sample->setText("Hello");
        m_Container->add(Sample);
    
        for(int i=0;i<12;i++){
            m_Trackers[i] = ImageView::create().image(QUrl("asset:///images/bullet-24-24.png"));
            m_Container->add(m_Trackers[i]);
        }
        setRoot(m_Container);
        setPreferredSize(600,600);
    }
    
    /*
     * ImageSlider.h
     *
     *  Created on: Jun 10, 2013
     *      Author: lalthomas
     */
    
    #ifndef IMAGESLIDER_H_
    #define IMAGESLIDER_H_
    
    #include 
    #include 
    #include 
    #include 
    
    namespace bb {
    namespace cascades {
    class Container;
    class ImageView;
    class TouchEvent;
    }
    }
    
    class ImageSlider: public bb::cascades::CustomControl {
        Q_OBJECT
    public:
        ImageSlider(bb::cascades::Container *parent = 0);
        virtual ~ImageSlider();
    private:
        float m_width;
        float m_height;
        bb::cascades::ImageView *m_Trackers[12];
        bb::cascades::ImageView *m_SlideImages[12];
        bb::cascades::Image m_Tracker;
        bb::cascades::Image m_TrackerCurrent;
        bb::cascades::Container *m_Container;
        bb::cascades::Label *Sample;
    };
    
    #endif /* IMAGESLIDER_H_ */
    
    // Default empty project template
    import bb.cascades 1.0
    
    // creates one page with a label
    Page {
        Container {
            layout: DockLayout {}
            Label {
                text: qsTr("Hello World")
                textStyle.base: SystemDefaults.TextStyles.BigText
                verticalAlignment: VerticalAlignment.Center
                horizontalAlignment: HorizontalAlignment.Center
            }
            ImageSlider {
                id: slider
                horizontalAlignment: HorizontalAlignment.Center
                verticalAlignment: VerticalAlignment.Center
            }
        }
    }
    
    // Default empty project template
    #include "applicationui.hpp"
    #include "ImageSlider.h"
    
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    
    #include 
    #include 
    
    ApplicationUI::ApplicationUI(bb::cascades::Application *app)
    : QObject(app)
    {
    
        // Register our custom control
        qmlRegisterType("custom.lib", 1, 0, "ImageSlider");
        // create scene document from main.qml asset
        // set parent to created document to ensure it exists for the whole application lifetime
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    
        // If the QML document is valid, we process it.
           if (!qml->hasErrors()) {
    
               // Create the application Page from QMLDocument.
               Page *appPage = qml->createRootObject();
    
               if (appPage) {
                   // Set the main scene for the application to the Page.
                   Application::instance()->setScene(appPage);
               }
           }
    }
    

    In short, I'd add this in your QML file...

    import custom.lib 1.0
    
  • Image downloaded from the server: Blue effect

    Hello

    I downloaded the Image to the server. Holding her blue effect.

    Code or even is:

    ImageView* imageView = page->findChild("image");
            if (success) {//show the image
                if (imageView) {
                    QImage qImage = img->getImage().rgbSwapped().scaled(768, 500, Qt::KeepAspectRatioByExpanding); //resize image to fit container
                    imageView->setImage(fromQImage(qImage));
                }
            }
    

    The shadow of the lights, please...

    What is the img type? I don't think you need the rgbSwapped.

  • java.lang.IllegalArgumentException: URL invalid or resource not found

    I tested this code:
    import javafx.application.Application;
    import javafx.geometry.Insets;
    import javafx.geometry.Pos;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.image.Image;
    import javafx.scene.image.ImageView;
    import javafx.scene.layout.BorderPane;
    import javafx.scene.layout.HBox;
    import javafx.scene.text.Text;
    import javafx.stage.Stage;
    
    public class DX57DC extends Application
    {
    
        public static void main(String[] args)
        {
            Application.launch(args);
        }
    
        @Override
        public void start(Stage primaryStage)
        {
    
            // Image
            Image image = new Image("dialog-information.png");
            ImageView imageView = new ImageView();
            imageView.setImage(image);
    
            // Text
            Text t = new Text();
            t.setText("Do you want to quit?");
    
            // Buttons
            Button btnYes = new Button("Yes");
            Button btnNo = new Button("No");
            btnYes.setStyle("-fx-background-color:\n"
                    + "        #090a0c,\n"
                    + "        linear-gradient(#38424b 0%, #1f2429 20%, #191d22 100%),\n"
                    + "        linear-gradient(#20262b, #191d22),\n"
                    + "        radial-gradient(center 50% 0%, radius 100%, rgba(114,131,148,0.9), rgba(255,255,255,0));\n"
                    + "    -fx-background-radius: 5,4,3,5;\n"
                    + "    -fx-background-insets: 0,1,2,0;\n"
                    + "    -fx-text-fill: white;\n"
                    + "    -fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0 , 1 );\n"
                    + "    -fx-font-family: \"Arial\";\n"
                    + "    -fx-text-fill: linear-gradient(white, #d0d0d0);\n"
                    + "    -fx-font-size: 12px;\n"
                    + "    -fx-padding: 10 20 10 20;");
    
            btnNo.setStyle("-fx-background-color:\n"
                    + "        #090a0c,\n"
                    + "        linear-gradient(#38424b 0%, #1f2429 20%, #191d22 100%),\n"
                    + "        linear-gradient(#20262b, #191d22),\n"
                    + "        radial-gradient(center 50% 0%, radius 100%, rgba(114,131,148,0.9), rgba(255,255,255,0));\n"
                    + "    -fx-background-radius: 5,4,3,5;\n"
                    + "    -fx-background-insets: 0,1,2,0;\n"
                    + "    -fx-text-fill: white;\n"
                    + "    -fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0 , 1 );\n"
                    + "    -fx-font-family: \"Arial\";\n"
                    + "    -fx-text-fill: linear-gradient(white, #d0d0d0);\n"
                    + "    -fx-font-size: 12px;\n"
                    + "    -fx-padding: 10 20 10 20;");
    
            // Buttons layout
            HBox hbox = new HBox(8); // spacing = 8
            hbox.setStyle("-fx-padding: 15; -fx-font-size: 15pt;");
            hbox.getChildren().addAll(btnYes, btnNo);
            hbox.setAlignment(Pos.BASELINE_RIGHT);
    
            BorderPane bp = new BorderPane();
            bp.setStyle("-fx-background-color: linear-gradient(#ffffff,#f3f3f4);\n"
                    + "    -fx-border-width: 1 1 1 1;\n"
                    + "    -fx-border-color: #b4b4b4 transparent #b4b4b4 transparent;\n"
                    + "    -fx-font-size: 1.083333em;\n"
                    + "    -fx-text-fill: #292929;");
    
            bp.setPadding(new Insets(10, 20, 10, 20));
            //Button btnTop = new Button("Top");
            bp.setTop(null);
            //Button btnLeft = new Button("Left");
            bp.setLeft(imageView);
            //Button btnCenter = new Button("Center");
            bp.setCenter(t);
            //Button btnRight = new Button("Right");
            bp.setRight(null);
            //Button btnBottom = new Button("Bottom");
            bp.setBottom(hbox);
            Scene scene = new Scene(bp, 500, 200);
            primaryStage.setScene(scene);
            primaryStage.show();
        }
    }
    I get this error:
    Executing com.javafx.main.Main from /home/rcbandit/Desktop/test/DX-57DC/dist/run1951682008/DX-57DC.jar using platform /opt/jdk1.8.0/bin/java
    Exception in Application start method
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:491)
         at com.javafx.main.Main.launchApp(Main.java:642)
         at com.javafx.main.Main.main(Main.java:805)
    Caused by: java.lang.RuntimeException: Exception in Application start method
         at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:403)
         at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
         at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
         at java.lang.Thread.run(Thread.java:724)
    Caused by: java.lang.IllegalArgumentException: Invalid URL: Invalid URL or resource not found
         at javafx.scene.image.Image.validateUrl(Image.java:986)
         at javafx.scene.image.Image.<init>(Image.java:538)
         at com.dx57dc.main.DX57DC.start(DX57DC.java:28)
         at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
         at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:215)
         at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
         at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
         at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
         at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
         at com.sun.glass.ui.gtk.GtkApplication$3$1.run(GtkApplication.java:82)
         ... 1 more
    Caused by: java.lang.IllegalArgumentException: Invalid URL or resource not found
         at javafx.scene.image.Image.validateUrl(Image.java:979)
         ... 12 more
    Java Result: 1
    Deleting directory /home/rcbandit/Desktop/test/DX-57DC/dist/run1951682008
    jfxsa-run:
    BUILD SUCCESSFUL (total time: 3 seconds)
    I placed the image file next to the java source code file, but the file is not found. Can you tell me how to solve this problem?

    Replace

    Image image = new Image("dialog-information.png");
    

    with

    Image image  = new Image(getClass().getResourceAsStream("dialog-information.png "));
    

    Do not forget to clean, and then build the project.

Maybe you are looking for

  • SUMIF error

    I'm new to apple and get a syntax error when you use SUMIF.  In my table, I just need column F to test the value of column E.  If it is greater than 0, then divide by 20.  Thank you!

  • Copy and paste functions work intermittently.

    Windows 8; FF 26 - does not: cut and paste - not always. I noticed that copy is grayed out in the Edit menu, so I can't yet do this way. I have to drag the selected text. I don't have zone alarm or other things that other people have installed. Is th

  • Tecra M2 - black screen with blinking cursor

    Hi guys,. Im hoping someone out there might be able to help me fix my laptop.Ive read a few posts, but not sure they can help me. When I swicth on my Tecra M2, I just end up with a black screen with blinking cursor top-left, or I get a screen filled

  • OfficeJet 8500 has Pro Plus: elimination of printer

    Just to check what I've read.  I want to give my Officejet 8500 a Pro Plus but am concerned there may be personal information stored somewhere on the printer. Are there other data stored on the device, for example information copied from documents? I

  • HP touchsmart PC 320: WLAN network connections missing icon

    My computor has stopped working on the WiFi network in our House at night, all other computor at home always connects to the modem router wifi and work very well it is just this computor ceased and it not same reconising Wi - Fi and networking in the