Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 151
Registered: ‎09-28-2012
My Device: Blackberry Developer
My Carrier: Aircel
Accepted Solution

How to create thumbnail image

I have a number of images , i want to show thumbnails of images...

 

how can i do it..

 

Thank you..Smiley Happy


----------------------------------------------------------
Feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: How to create thumbnail image

QImage has scaling functions.

 

http://qtdocs.narod.ru/4.1.0/doc/html/qimage.html


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 151
Registered: ‎09-28-2012
My Device: Blackberry Developer
My Carrier: Aircel

Re: How to create thumbnail image

can you refer some sample of code...


----------------------------------------------------------
Feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
Developer
Posts: 828
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

Re: How to create thumbnail image

[ Edited ]

I know how to do this using QML

 

The animation will scale the container holding the imageview because the animation is defined in the container

Container {
id: scaledContainer ImageView { imageSource: "asset:///myImage.png" } animations: [ ScaleTransition { id: scaleAnimation toX: 0.5 // 1/2 size toY: 0.5 // 1/2 size duration: 0 //instant } ] } onCreationCompleted: { scaleAnimation.play(); }

 

Developer
Posts: 38
Registered: ‎01-13-2013
My Device: BlackBerry Z10, Q10
My Carrier: Claro (Brazil)

Re: How to create thumbnail image

Use a QImageReader to load and and create a downscaled/cropped version of the image, as described here.

Highlighted
Developer
Posts: 151
Registered: ‎09-28-2012
My Device: Blackberry Developer
My Carrier: Aircel

Re: How to create thumbnail image

thanx a lot guys..

 

for helping me...


----------------------------------------------------------
Feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
Developer
Posts: 151
Registered: ‎09-28-2012
My Device: Blackberry Developer
My Carrier: Aircel

Re: How to create thumbnail image

problem is solve...

we can take a ImageView and can define the preferredWidth and preferredHeight...

 


----------------------------------------------------------
Feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
Developer
Posts: 38
Registered: ‎01-13-2013
My Device: BlackBerry Z10, Q10
My Carrier: Claro (Brazil)

Re: How to create thumbnail image

Be warned that if you show a large number of images at the same time they will all be loaded into memory together. This is not a problem with small images for large files (e.g. from the camera folder) they can easily exhaust the menory.