Android 게임에서 작업 중이며 약간의 문제가 있습니다. 비트 맵 객체에 색상을 채우고 싶지만 색상을 채울 수는 있지만 이미지는 PNG 형식입니다. 및 로이드 (원형 또는 날카롭지, 투명한 색으로 둘러싸인 같은) getHeight 수() 또는 getWidth(), 즉안드로이드에서 비트 맵 객체를 채우는 방법
ImageView i = new ImageView(mContext); Bitmap bMap = BitmapFactory.decodeResource(this.mContext.getResources(), mImageIds[position]);// for(int i1 = 0; i1 < bMap.getHeight();i1++) // for(int j = 0; j < bMap.getWidth(); j ++) // bMap.setPixel(i1, j, Color.RED); //can not set
i.setImageBitmap(bMap); i.setLayoutParams(new Gallery.LayoutParams(150, 100)); i.setScaleType(ImageView.ScaleType.FIT_XY); i.setBackgroundResource(mGalleryItemBackground); i.setBackgroundColor(Color.TRANSPARENT);