Android Forums

Go Back   Android Forums > Android Coders > Android Development, Answers, Tutorials, and Code Snippets
Connect with Facebook

Click Here To Register!
Reply
 
LinkBack Thread Tools Display Modes
Old 12-06-2009, 10: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
Reply With Quote
Old 01-17-2010, 05: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
Reply With Quote
Reply

Thread Tools
Display Modes



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


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

All times are GMT -6. The time now is 11:25 PM.


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