我从浏览器级别安装了购买的模板。我无法按照指示进行操作:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tempbitmap= Bitmap.createBitmap(bitmap.getWidth(),bitmap.getHeight(),Bitmap.Config.RGB_56);
imageView = (ImageView)findViewById(R.id.imageView);
button = (Button) findViewById(R.id.button)
canvas = new Canvas(tempbitmap);
final Paint paint = new Paint();
paint.setStrokeWidth(5);
paint.setColor(Color.RED);
paint.setStyle(Paint.Style.STROKE);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FaceDetector faceDetector = new FaceDetector.Builder(getApplicationContext())
.setTrackingEnabled(false)
.setLandmarkType(FaceDetector.ALL_LANDMARKS)
.setMode(FaceDetector.FAST_MODE)
.build();
frame = new Frame.Builder().setBitmap(bitmap).build();
SparseArray<Face> sparseArray = faceDetector.detect(frame);
for (int i=0;i<sparseArray.size();i++)
{
Face face = sparseArray.valueAt(i);
float x = face.getPosition().x;
float y = face.getPosition().y;
float x1 = x + face.getWidth();
float y1 = y + face.getHeight();
RectF rectF = new RectF(x,y,x1,y1);
canvas.drawRoundRect(rectF,2,2,paint);
}
imageView.setImageBitmap(tempbitmap);
}
});
}
错误:“索引器”名称空间中没有定义命令。
我现在很绝望。我尝试了一切。我无法解决这个问题。
当我要打开主页时,它总是重定向到/设置
WINDOWS / WAMP