[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
2 replies
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:
- Flickable{
- clip:true
- width: 150
- height:150
- contentWidth: image.width
- contentHeight: image.height
- Image{
- id: image
- source: "image/source.png"
- }
- }
Does this do what you need?
You must log in to post a reply. Not a member yet? Register here!

