我必须制作和申请表片,显示新的杂志及其网页。 每个杂志都有大约70页,每一页都有大约700 000台 by的图像。 主要读物显示大形象和小孔(Gall Viewery)的图像。 我与3.2国合作。 当我增加画面,我尝试幻灯片时,它确实进展顺利。 有时甚至装上所有图像,LogCat显示我这一信息:
11-17 14:30:51.598: D/skia(5868): libjpeg error 105 < Ss=%d, Se=%d, Ah=%d, Al=%d> from read_scanlines [128 168]
11-17 14:30:51.598: D/skia(5868): --- decoder->decode returned false
Now I put into gallery about 7 images which I scale like this:
public Bitmap decodeFile(String f) {
try {
BitmapFactory.Options o = new BitmapFactory.Options();
o.inJustDecodeBounds = true;
BitmapFactory.decodeStream(new FileInputStream(f),null,o);
final int REQUIRED_SIZE=75;
int width_tmp=o.outWidth, height_tmp=o.outHeight;
int scale=1;
while(true) {
if(width_tmp/2<REQUIRED_SIZE || height_tmp/2<REQUIRED_SIZE)
break;
width_tmp/=2;
height_tmp/=2;
scale*=2;
}
BitmapFactory.Options o2 = new BitmapFactory.Options();
o2.inSampleSize=scale;
return BitmapFactory.decodeStream(new FileInputStream(f), null, o2);
} catch (FileNotFoundException e) {}
return null;
}
并且如上所示:
public View getView(int position, View convertView, ViewGroup parent) {
View retval = LayoutInflater.from(parent.getContext()).inflate(R.layout.viewitem, null);
ImageView iV = (ImageView) retval.findViewById(R.id.image);
String path = ArrayHelper.list.get(position).get("pageId").toString();
Bitmap bP = decodeFile(Environment.getExternalStorageDirectory() + "/MCW/" + path + "/head.jpg");
iV.setImageBitmap(bP);
return retval;
}
今后,我会有更多的热情,我可以想象会如何工作。
我的问题是:应该做些什么? 我应如何装上图像?