Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-31539

Mistake in documentation: getImageData is not a method of Canvas

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 5.0.2
    • None

    Description

      The documentation states that QtQuick 2.0 Canvas has the method getImageData(...):
      http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-canvas.html#getImageData-method

      However, trying to access the method results in an error:
      TypeError: Object QQuickCanvasItem(...) has no method 'getImageData'

      I believe getImageData is really a method of the Canvas' context.

      Example
          Canvas {
              id: canvas
              width: 300; height: 300
              onPaint: {
                  console.log(canvas.getImageData(0, 0, canvas.width, canvas.height));    // TypeError
                  console.log(canvas.getContext('2d').getImageData(0, 0, canvas.width, canvas.height)); // Ok
              }
          }
      
      

      Attachments

        For Gerrit Dashboard: QTBUG-31539
        # Subject Branch Project Status CR V

        Activity

          People

            aalpert Alan Alpert
            billy_blaze42 Hannes Rantzsch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes