Android Forums

Go Back   These FORUMS ARE DISABLED!! OUR NEW FORUMS ARE AT http://androidforum.com/ > Android Coders > Android Development, Answers, Tutorials, and Code Snippets
Connect with Facebook

Click Here To Register!
 
 
LinkBack Thread Tools Display Modes
Old 12-06-2009, 09:02 AM   #1
Junior Member
 
Join Date: Dec 2009
Posts: 1
Friends: 0
View ytreza57's Profile   View ytreza57's Photo Album   View ytreza57's Blog   View Social Groups
Hi all !

Here is my problem :
I would to make a simple application. The aim is to display map, which is a jpg picture. The user could move and zoom on it, in order to view a particular place. So the picture has to be in high quality.

So I start to load my picture from ressource with :
Variable : private Drawable image;
In my class constructor : image=context.getResources().getDrawable(R.drawabl e.mypicture);

The original picture size is 3543x2300 and its weight is 498ko. But when the load instruction is running, the emulator gives me this error : "VM won't let us allocate 16297800 bytes".

I thought that load a picture of this huge size will cause some problems, but I really don't know how to solve it... Maybe use OpenGL 2D or something like that...

Can you give me some help, please ?

Thank you everyone !
ytreza57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati
Old 01-17-2010, 04:10 AM   #2
Junior Member
 
Join Date: Jan 2010
Posts: 1
Friends: 0
View proteus's Profile   View proteus's Photo Album   View proteus's Blog   View Social Groups
Quote:
Originally Posted by ytreza57 View Post

The original picture size is 3543x2300 and its weight is 498ko. But when the load instruction is running, the emulator gives me this error : "VM won't let us allocate 16297800 bytes".

Thank you everyone !
Actually your bitmap size is 3543x2300x2 = 16297800 bytes (in case of RGB565). Try to use BitmapFactory.Options.inSampleSize and BitmapFactory.decodeFile
proteus is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati
 

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Manage SIM card messages problem Bismarck G1 0 09-20-2009 07:21 PM
Picture transfering diverdad69 G1 1 09-05-2009 11:29 AM
Need help. picture message not working landotheripper Android Chat 3 01-08-2009 01:26 PM
What is the MMS picture location krzysiopl Android Chat 3 11-12-2008 07:59 AM
G1 internet via usb? picture messages? antzombie280 T-Mobile, Vodafone, Sprint, Verizon, Rogers, AT&T etc. 0 11-03-2008 01:43 PM


Unlocked G1 Phones | Buy T-Mobile G1 | Google Phone

All times are GMT -6. The time now is 08:16 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.
Copyright (c) 2012 TalkAndroid.com. All rights reserved.