Skip to main content

Posts

Showing posts from August, 2014

Resizing image in Blackberry 10 Cascades

In this post we will learn how to re-size an image stored on file or in memory. Cascades provide Image class to perform loading of images but it do not have any support for manipulating the image especially re-sizing of image. But we have a class QImage from Qt that support re-sizing of images. So first lets see how we can load image through QImage class Loading image QImage has many overloaded constructors for loading images from different sources or just create an empty QImage of given height and width. We will cover two constructors here, one for loading image from file and other to load image from image data in memory. Loading from file We will use a constructor that takes file name (QString) as a parameter. We can optionally pass format as a char* parameter but its better to skip that so QImage will detect format from the filename QImage img("asset:///testimage.jpg"); Loading from in memory data QImage provides another constructor to load image data stored