May 3, 2012

[solved]QML and Partial Image Displaying

Hi,

is it possible to display q quarter of an image ? I mean, is it possible to specify how much of the image you want to display with proportion preservation. Displaying the end or the begginning. In QML or in QML with C++… Anything that can be plugged into QML.

Thanks

Signature

Trust me, i’m an engineer !

2 replies

May 3, 2012

An easy way to begin with is to place an Image element in a Rectangle[doc.qt.nokia.com] element. Let Rectangle be smaller than the Image and in the Rectangle set the clip:true. This show only a part of the Image.

Rectangle{

clip:true

width:150

height:150

Image{

source:"image/source.png"

}

}

To go a bit further replace the Rectangle with a Flickable[doc.qt.nokia.com] element. Thus if the image is smaller than the size of the Flickable you will be able to scroll the view of the image. So: