How to copy any part of the image to the other item in QML
I have image inside rectangle with size e.g. 400x900. I need to scale/zoom part of the image in other place. If pressing some part of image e.g 50x50 size that part I need to copy and zoom in. How to do it?
I have tried opacitymask and grapToImage with no success.
Hi @Lisbetti and Welcome,
AFAIK you will need some C++ API's as well for cropping the image. Once you grab the image using
grapToImagecall 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
QImagewhich you can send it to QML again for displaying.
Note: If you are a beginner C++ and QML interaction may sound a bit tedious. Pls refer the fine docs for further explanation: