@stcorp I'll have to look at that later, but I didn't know about the resizeContent method from Flickable. From waht I'm seeing in your code and in the documentation, this looks like a good solution. Thanks!
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.
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.
I don't know of any but it should be quite straightforward to implement. Basically you map coordinates from one space to another based on a parametric transformation (a matrix) and then interpolate where the pixels are closer/farther from one another.
Hi @Lisbetti and Welcome,
AFAIK you will need some C++ API's as well for cropping the image. Once you grab the image using grapToImage call a C++ function and pass this image to it for further processing. Once you receive it on C++ side you have QImage::copy function to copy the desired part. This function too returns a QImage which you can send it to QML again for displaying.
Okay, so the idea here is to utilize the Item element's grabToImage method to save everything inside the element to a file. Placing the Image inside the Item, and calling the method provides the feature I was looking for. Thanks, @p3c0!
EDIT: I hadn't realized the grabToImage method is an inherited method in Image. The use of a wrapping Item is unnecessary in this case. I should also note that this method does not save the actual image, but a lower resolution copy, as quoted from the documentation: "This function will render the item to an offscreen surface and copy that surface from the GPU's memory into the CPU's memory, which can be quite costly." Is there a better way of saving the full resolution image to a file without having to request it from it's source a second time? This sort of brings me back to my original question.