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
New Contributor
a27med
Posts: 6
Registered: ‎03-12-2012
My Carrier: Non

Image Resize

Hello All,

 

I am trying to resize an image so that it fits the screen. Unfortunately I am not getting anything to work. Whenever I try to resize an image using img_load_resize_file() or img_resize_fs() with setting the right flags for width and height, I either get an overly stretched image or very very tiny image instead of an image that correctly fits the screen.

 

For width and height, I am using size[0] and size[1] from screen_get_window_property and using the pname SCREEN_PROPERTY_SIZE.

 

Can anyone help me with this? All I need is to fit an image to my screen. I am not using OpenGL and trying to load the image as in the Gesture sample application.

 

Thanks,

A27med

Please use plain text.
New Contributor
likonyu
Posts: 4
Registered: ‎03-25-2012
My Carrier: rim

Re: Image Resize

This is very disappointing, I also tried the same operation ,it is unsuccessful! But I found that if the image is relatively large, can make small adjustments to the size of the picture by setting SCREEN_PROPERTY_SOURCE_SIZE, set the SCREEN_PROPERTY_SOURCE_POSITION property to adjust the location of the picture .

 I hope this will give you some help!

Please use plain text.
New Contributor
a27med
Posts: 6
Registered: ‎03-12-2012
My Carrier: Non

Re: Image Resize

All I am trying to do is to get my background image to resize without maintaining aspect ratio. The functions for resizing in the BlackBerry API don't allow this but tend to maintain aspect ratio. Is there anyway I can get this to work? Even from just C?
Please use plain text.
New Contributor
likonyu
Posts: 4
Registered: ‎03-25-2012
My Carrier: rim

Re: Image Resize

I have not any idea,the image functions are very pool,may be you can try to use OpenGL,i will try to use it to adjust the picture layout yet.

Please use plain text.