作为我项目的一部分, 我正面对着以下的java 代码。
BitmapFactory.Options BitmapFactoryOptionsbfo = new BitmapFactory.Options();
/*BitMapFactory-Creates Bitmap objects from various sources, including
* files, streams, and byte-arrays.
*/
BitmapFactoryOptionsbfo.inPreferredConfig = Bitmap.Config.RGB_565;
imageWidth = myBitmap.getWidth();
imageHeight = myBitmap.getHeight();
myFace = new FaceDetector.Face[numberOfFace];
myFaceDetect = new FaceDetector(imageWidth, imageHeight, numberOfFace);
numberOfFaceDetected = myFaceDetect.findFaces(myBitmap, myFace);
}
//i get error over there in R.drawable.pics
myBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.pics, BitmapFactoryOptionsbfo);
I am supposed to give the name of the pic file in pics but it keeps giving me an error pics cannot be resolved or is not a field. So I set the name of the pic file as pic PS it s a jpg file in the drawable folder. I also named the file within single quotes as pic ---it gives me Invalid character constant error.
我也用双引号给它命名,但还是行不通。我还给它命名,pic.jpg仍然不起作用。