Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. image
    Log in to post

    • UNSOLVED Load SVG image with parameters
      QML and Qt Quick • qml image quick svg • • SroDev  

      1
      0
      Votes
      1
      Posts
      123
      Views

      No one has replied

    • SOLVED Javascript Image is not defined in QML
      QML and Qt Quick • javascript image canvas • • MattP2  

      4
      0
      Votes
      4
      Posts
      272
      Views

      You're right. Thanks for answering. I finally ended with a QImageProvider. My image provider takes a filename followed by a question mark and a color (image://myimageprovider/myicon.svg?red). I can then colorize my svg file (this is why i needed a new Image() ) from my image provider. This is the qml part. import QtQuick 2.11 Canvas { width: 200 height: 200 property string imageUrl: "image://myimageprovider/myicon.svg?red" Component.onCompleted: loadImage(imageUrl) onImageLoaded: requestPaint(); onPaint: { var ctx = getContext("2d"); ctx.drawImage(imageUrl, 0, 0, 32, 32); } }
    • SOLVED Pixmap from QImage is broken
      General and Desktop • image image display pixmap littlecms • • ademmler  

      15
      0
      Votes
      15
      Posts
      461
      Views

      Here is the reason and solution. Thanks to Marti Maria - the author of littlecms - to sort this out ... This program does not work because you missed the part on https://littlecms.com/blog/2020/12/09/using-lcms2-on-qt/ that says: Alpha channels are supported as long as the image is not using premultiplied alpha. To get alpha channel make sure to include cmsFLAGS_COPY_ALPHA in the flags field. This is explained in LittleCMS documentation. So, try: toDisplay = colorManage(sourceImage, profiles, INTENT_PERCEPTUAL, cmsFLAGS_COPY_ALPHA);* This fixed the issue for me.
    • SOLVED Issues with loadFromData function in QImage
      General and Desktop • qimage image qpixmap taglib issue • • Nick Redwill  

      14
      0
      Votes
      14
      Posts
      499
      Views

      @Nick-Redwill This is what windeployqt is for...
    • UNSOLVED Right format to use to display an image cv::Mat CV_32F normalized
      General and Desktop • image opencv qt image • • Rui f  

      2
      0
      Votes
      2
      Posts
      284
      Views

      Hi and welcome to devnet, You can't jump from a 32bit float image to 16bit integer one like that. Convert your OpenCV image to 16 bit before making a QImage out of it.
    • UNSOLVED Modify an image based on slider position PyQT5
      QML and Qt Quick • pyqt5 desktop qimage image slider • • sh-r  

      5
      0
      Votes
      5
      Posts
      275
      Views

      Did you consider using the QtGraphicalEffects module ?
    • UNSOLVED Custom image linear gauge possible?
      QML and Qt Quick • qml image gauge linear rpm • • failedcomp  

      1
      0
      Votes
      1
      Posts
      236
      Views

      No one has replied

    • UNSOLVED QImage to byte array doesn't work
      General and Desktop • qimage image bytearray epd esp8266 • • Gh0stShell  

      5
      0
      Votes
      5
      Posts
      782
      Views

      QImage::save() doesn't get the raw bytes of the image, it converts the image to a file format. If you really want the raw bytes, do something like QByteArray ba((const char *)preview.constBits(), preview.byteCount());
    • UNSOLVED Latlong position over any world map image using at charts
      General and Desktop • qt5 image charts qtchart • • vicky_mac  

      3
      0
      Votes
      3
      Posts
      278
      Views

      @Kent-Dorfman thanx for reply. Actually I saw few java script programs for pointing accurate pixel values on image by using Mercator projection and it's formula. I checked it works fine in Java script. But in qt I want to display whole lat long trace so wanted to plot chart with image as it's background. But not able to correctly det the background image as per chart x and y axis values.
    • UNSOLVED Modify the qsvg plugin to support animation with AnimatedImage - Possible?
      QML and Qt Quick • plugin image animation svg qt quick 2.0 • • jeanmilost  

      1
      1
      Votes
      1
      Posts
      217
      Views

      No one has replied

    • UNSOLVED HTML - SVG images inserted in a text document show ugly
      QML and Qt Quick • image text html svg stretch • • jeanmilost  

      5
      0
      Votes
      5
      Posts
      622
      Views

      Is it possible to to extend QLabel and implement my own paintEvent() that draws the text and draws the svg image? It seems to work, but would problaby take alot of effort to get it right (i.e. to get the image in the right location everytime). void MypLabel::paintEvent(QPaintEvent* event) { QPainter painter(this); const auto pos = QPoint(0, 16); painter.drawText(pos, this->text()); const auto posPixMap = QPoint(30, 0); auto size = QSize(16, 16); auto pixMap = QIcon(":/Resources/smiley.svg").pixmap(size); painter.drawPixmap(posPixMap, pixMap); }
    • UNSOLVED Qt Quick Controls 2 - How to grab the items contained in a TableView in images in order to print them?
      QML and Qt Quick • image qtquick2 printing grab printtopdf • • jeanmilost  

      1
      0
      Votes
      1
      Posts
      194
      Views

      No one has replied

    • UNSOLVED zooming an SVG image
      QML and Qt Quick • qml image memory zoom scale • • Marc_Van_Daele  

      1
      0
      Votes
      1
      Posts
      339
      Views

      No one has replied

    • UNSOLVED Enter different images
      General and Desktop • image image display qgraphics entrylist • • Omar Medhat  

      8
      0
      Votes
      8
      Posts
      343
      Views

      @Omar-Medhat Show your current void MainWindow::on_openImage_clicked() implementation. The previous one was wrong as @SGaist pointed out...
    • SOLVED Help optimize (or properly load) multiple images into a QListWidget (out of memory issue)
      General and Desktop • image qlistwidget image display out of memory thumbnail • • Electrolite  

      4
      0
      Votes
      4
      Posts
      874
      Views

      @mrjj I see, thank you. I'm going for that route then
    • UNSOLVED using resources system with qml
      QML and Qt Quick • qml qt5 image resource interface • • newbiSoso  

      8
      0
      Votes
      8
      Posts
      536
      Views

      Hi @newbisoso , See this, it may help you
    • SOLVED Problem loading an image with QImage
      General and Desktop • error qimage image path qopengltexture • • JesusM  

      5
      0
      Votes
      5
      Posts
      1473
      Views

      @KillerSmath That solved my problem. Thanks!
    • UNSOLVED Gamma correction for display
      General and Desktop • pyside2 image • • krzysieklfc  

      2
      0
      Votes
      2
      Posts
      739
      Views

      @krzysieklfc said in Gamma correction for display: Shouldn't Qt somehow handle the color correction when I'm 'telling it' to view the image? no! why should it? I don't quite understand why you are dividing by 256? Also whats the returning type of GetR()/GetG()/GetB()?
    • UNSOLVED Is there a simple way to use pinch to zoom an image at the center of the pinch gesture?
      QML and Qt Quick • qml image zoom pincharea pinch • • larkei15  

      5
      1
      Votes
      5
      Posts
      2426
      Views

      QZoomableImage
    • UNSOLVED Rendering error after changing the size of Window
      QML and Qt Quick • image window • • wangfys  

      4
      0
      Votes
      4
      Posts
      804
      Views

      @wangfys I got exactly the same behavior as you. Although I never used the scene graph before, your example (+ the doc and the Custom Geometry example in Qt's examples) gave me a little crash course in the topic. http://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph.html Your example really should work as it seems you did everything as required by the doc. At my side, the lines become visible once I hover the mouse one the exit button. Possibly this is a bug? PS. Again, not being useful, I maybe I could suggest you to change the definition of your points from QVariantList points; to QVector<QPointF> points; Then you can use: const float x = static_cast<float>(points[i].x()); const float y = static_cast<float>(points[i].y()); vertices[i].set(x, y); rather than vertices[i].set(points[i].toPointF().x(), points[i].toPointF().y()); as it saves you a couple of calls to toPointF().
    • UNSOLVED Smoothed icons with high dpi support in Qt app
      General and Desktop • image scaling high dpi qt 5.11 • • daljit97  

      2
      0
      Votes
      2
      Posts
      2200
      Views

      Hi, Did you already saw the related part of QIcon’s documentation ?
    • SOLVED Resize image to fit in graphics view
      General and Desktop • qtcreator qt5.5 image images listwidget • • Kinesis  

      9
      0
      Votes
      9
      Posts
      7638
      Views

      @Devopia53 It works! , Thanks.
    • UNSOLVED Image, loading *.pkm file(ETC1) issue
      QML and Qt Quick • image pkmfile etc1compression • • divdiv  

      1
      0
      Votes
      1
      Posts
      730
      Views

      No one has replied

    • SOLVED macOS Image Gallery deploy
      QML and Qt Quick • qml qtquick image osx macosx • • shav  

      2
      0
      Votes
      2
      Posts
      598
      Views

      Hi everyone! I've solved this problem. In my case the problem was in asynchronous load images into another thread. When I changed asynchronous method to the synchronous all work fine.
    • UNSOLVED Exif Meta info for JPG and PNG
      General and Desktop • c++ image png jpg exif • • shav  

      2
      0
      Votes
      2
      Posts
      947
      Views

      Hi, AFAIK, PNG doesn't contain the same meta data so you won't be able to use QExifImageHader to read them.
    • SOLVED Resize image with mouse QTextEdit
      General and Desktop • image resize qtextedit mouse • • HenrikSt.  

      10
      0
      Votes
      10
      Posts
      3978
      Views

      @mrjj I don't want to resize it via a dialog. I need to do that with the mouse (manually)
    • UNSOLVED Compare two images for similarity
      General and Desktop • image image processin • • sush  

      6
      0
      Votes
      6
      Posts
      1596
      Views

      @sush this is actually outside of the scope of Qt. You should use a graphics processing library (like OpenCV - i don't know if it offers such functionality) to do such stuff. Or you need to implement an appropriate algorithmn yourself which uses the Qt API to access the pixel data. This is by far a complicated topic. You may want to read the following links: Overview Perceptual Image Diff lib QGoImageComapre
    • SOLVED Image viewer - moving to previous image in directory
      General and Desktop • image qstringlist directory • • Avec  

      13
      0
      Votes
      13
      Posts
      4535
      Views

      @Avec Oh duh.. I should have thought of that as a potential reason. I just assumed that you were in the directory with the files as your current dir. Glad it's all solved. :)
    • UNSOLVED Handle ArrayBuffer received via WebSocket's binaryMessageReceived() with QML
      QML and Qt Quick • qml image websocket binary • • danyright  

      3
      0
      Votes
      3
      Posts
      1647
      Views

      Thanks for the link ! I haven't yet been able to get it working. But I suspect I should probably be using a Loader with a Canvas component, instead of a simple Image element. I'll test it out and let you know. If anyone has a working code, don't hesitate to share ^^ I'm sure it would be a great example to include in the docs. Daniel
    • UNSOLVED Display /provide QImage or pixel map in WebEngine view (from C++ to HTML).
      QtWebEngine • javascript image imageprovider hybrid qtwebegine • • zupazt3  

      2
      0
      Votes
      2
      Posts
      1394
      Views

      Well one way to do it is to use QWebEnginePage::runJavaScript but be careful it executes asynchronously! http://doc.qt.io/qt-5/qtwebenginewidgets-qtwebkitportingguide.html then in your javascript - find IMG element by id/class/whatever and set its contents like an embedded image e.g. change src to src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==' this is example 1x1 pixel black dot image you'll have to substitute with your own image data base64 encoded and of course change image format if you're not using png to data:image/jpg(whatever)
    • UNSOLVED Save Image of QGraphicview in SqlServer
      General and Desktop • image qt 5.4 sqlserver saving • • M4RZB4Ni  

      11
      0
      Votes
      11
      Posts
      3157
      Views

      @M4RZB4Ni yes, the big question is if they are on same lan/network. :)
    • UNSOLVED OpenGL Image Load/Store using Qt 5.7?
      General and Desktop • qt5 opengl image qt5.7 shader • • otah007  

      1
      0
      Votes
      1
      Posts
      829
      Views

      No one has replied

    • SOLVED HowTo position scaled Image Top/Left in Flickable in Page
      QML and Qt Quick • image qtquickcontrols positioning • • ekkescorner  

      3
      0
      Votes
      3
      Posts
      1566
      Views

      cool :) now the image is always correct positioned and visible while zoom-in/out or fit-into-screen QtCon2016 - Room Info to Session
    • UNSOLVED Clip QML Types with Context2D
      QML and Qt Quick • image canvas qml types context • • Mark81  

      4
      0
      Votes
      4
      Posts
      2609
      Views

      Out of curiosity, I implemented a QQuickPaintedItem-based PathMask type. The result looks like this: The code is: pathmask.h #ifndef PATHMASK_H #define PATHMASK_H #include <QObject> #include <QQuickItem> #include <QQuickPaintedItem> #include <QPainter> #include <QPainterPath> class PathMask : public QQuickPaintedItem { Q_OBJECT public: explicit PathMask(QQuickItem *parent = Q_NULLPTR); ~PathMask(); virtual void paint(QPainter *painter); Q_INVOKABLE void beginPath(); Q_INVOKABLE void moveTo(qreal x, qreal y); Q_INVOKABLE void lineTo(qreal x, qreal y); Q_INVOKABLE void closePath(); private: QPainterPath *m_path{Q_NULLPTR}; }; #endif // PATHMASK_H pathmask.cpp #include "pathmask.h" #include <QPainterPath> #include <QtMath> PathMask::PathMask(QQuickItem *parent) : QQuickPaintedItem(parent) { } PathMask::~PathMask() { delete m_path; } void PathMask::paint(QPainter *painter) { if (m_path) { painter->setRenderHint(QPainter::Antialiasing); painter->setBrush( QBrush(QColor("black")) ); painter->drawPath( *m_path ); } } void PathMask::beginPath() { delete m_path; m_path = new QPainterPath; update(); } void PathMask::moveTo(qreal x, qreal y) { Q_ASSERT(m_path); m_path->moveTo(x,y); } void PathMask::lineTo(qreal x, qreal y) { Q_ASSERT(m_path); m_path->lineTo(x, y); } void PathMask::closePath() { Q_ASSERT(m_path); m_path->closeSubpath(); update(); } main.qml import QtQuick 2.5 import QtQuick.Controls 2.0 import QtQuick.Controls.Material 2.0 import QtGraphicalEffects 1.0 import io.qt.forum 1.0 ApplicationWindow { title: "PathMask Demo" visible: true width: 400 height: 400 color: "black" Image { id: src anchors.fill: parent visible: false source: "file:///home/patrick/Downloads/f22.jpg" } PathMask { id: mask anchors.fill: parent visible: false } Component.onCompleted: { mask.beginPath() mask.moveTo(360, 200); var Pi = 3.141592653589793238463; for (var i = 1; i < 5; ++i) { mask.lineTo(200 + 160 * Math.cos(0.8 * i * Pi), 200 + 160 * Math.sin(0.8 * i * Pi)); } mask.closePath(); } OpacityMask { anchors.fill: src source: src maskSource: mask } }
    • SOLVED QML Image zoom screenshot
      QML and Qt Quick • qt 5.7 image screenshot • • eiriham  

      2
      0
      Votes
      2
      Posts
      1918
      Views

      Got it to work. Only had to do this: @ //Screenshot button RectangularButton{ id: screenshotButton text: "Screenshot" anchors.bottom: parent.bottom anchors.right: savePictureButton.left anchors.margins: 10 onClicked: { //Take screenshot of the image flick.grabToImage(function(result) { snapController.url = result.url }, Qt.size(snapshotViewItem.width,snapshotViewItem.height)); //Update zoom and update image to save flick.contentHeight = flick.height flick.contentWidth = flick.width } } @
    • SOLVED Save Image to Android device
      Mobile and Embedded • android qt 5.7 image save qurl • • eiriham  

      24
      0
      Votes
      24
      Posts
      10700
      Views

      @Qojote Thank you and congratulations for giving all the details for solving this old and apparently common problem! Without the smallest details, this kind of things are never solved.
    • UNSOLVED Need help optimizing the design of an image editor program
      General and Desktop • qimage image qlabel qpixmap image processin • • Wings  

      2
      0
      Votes
      2
      Posts
      1238
      Views

      Hi, QPainter can draw a QImage. So you can for example create a new Widget, subclass for QLabel for example if you want and reimplement paintEvent. Like this you work all the time with your QImage without creating another one. And better you can only update the region that changed, no need to refresh everything. I did not try it but it should work. Sincerely
    • SOLVED Some image not display on deploy app but display running by Qtcreator
      General and Desktop • image • • helenebro  

      6
      0
      Votes
      6
      Posts
      1312
      Views

      I have found the problem. I have added on build folder libeay32.dll and ssleay32.dll but not on deploy folder