Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Drawing Image on Canvas and maintain aspect ratio

Drawing Image on Canvas and maintain aspect ratio

Problems with Canvas, OpenGL, etc...

Drawing Image on Canvas and maintain aspect ratio

Postby gogodev » Mon Nov 08, 2010 6:21 pm

Hi,

I am new to android development. So pardon me if it is something very straightforward. I am trying to design a slide-show application. This application fetches images from my web-server. Many of these images are varying in size and in aspect ratio. I want to show each image on the screen as large as possible (without going beyond the screen and also maintaining the picture's aspect ratio). For the record I am drawing the image on canvas. What is the best way to go about doing this? If there are pointer's to sample application, I can take those and follow-up.

I have reviewed http://code.google.com/p/android-slideshow/. While this project is pretty neat, the image-scaling in this project does not seem to be optimal.

Thanks in Advance!!
gogodev
Freshman
Freshman
 
Posts: 2
Joined: Mon Nov 08, 2010 4:52 pm

Top

Re: Drawing Image on Canvas and maintain aspect ratio

Postby Schermvlieger » Mon Nov 08, 2010 7:05 pm

Hi Gogodev,

Check out the ImageView class on the developers reference site:

http://developer.android.com/reference/ ... eView.html

You can use ScaleType to control how the image is scaled inside the view.
Schermvlieger
Senior Developer
Senior Developer
 
Posts: 159
Joined: Fri Feb 26, 2010 1:37 pm

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests