android bitmap new,Android: How to: create a new copy of an existing Bitmap?

本文探讨如何创建一个动态地图应用,利用HashMap高效管理20个楼层对应的20512x512或256x256 PNG地图。关键问题包括如何复制和存储地图,以及使用Integer还是String作为Map键的选择。
摘要由CSDN通过智能技术生成

I will create a simple floor map guide. I have different FLOORS and the corresponding MAPS. FLOORS are buttons and MAPS are png files stored in the sdcard. When I click 1F and corresponding 1Fmap will be displayed and so with other floors.

I am thinking of the following:

one image view to show the selected map.

Hashmap ( OR ) to handle the bitmaps. use to obtain the bitmap based on the selected floor. then set to ImageView via setImageBitmap(..)

the bitmap to be assigned in the Hashmap are downloaded upon clicking of the floor button. then create the bitmap, set to imageview and the later on store to hashmap upon clicking the other floors.

Here are my technical/design problems:

how to create a copy of bitmap?

is it ok to store it to hashmap gradually or obtain it from the sdcard everytime the floor buttons are click?

if i will be using hashmap, is it ok to use Integer (floor numbers) or String (floornames) as map key?

UPDATE:

additional, I am targeting maximum of 20 floors (it means 20 512x512 png files...i am thinking also to adjust it to 256x256 as others suggested).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值