コード例 #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_image_process);
    ButterKnife.inject(this);
    EffectUtil.clear();
    initView();
    initEvent();
    initStickerToolBar();

    ImageUtils.asyncLoadImage(
        this,
        getIntent().getData(),
        new ImageUtils.LoadImageCallback() {
          @Override
          public void callback(Bitmap result) {
            currentBitmap = result;
            mGPUImageView.setImage(currentBitmap);
          }
        });

    ImageUtils.asyncLoadSmallImage(
        this,
        getIntent().getData(),
        new ImageUtils.LoadImageCallback() {
          @Override
          public void callback(Bitmap result) {
            smallImageBackgroud = result;
          }
        });
  }
コード例 #2
0
    @Override
    protected String doInBackground(Bitmap... params) {
      String fileName = null;
      try {
        bitmap = params[0];

        String picName = TimeUtils.dtFormat(new Date(), "yyyyMMddHHmmss");
        fileName =
            ImageUtils.saveToFile(
                FileUtils.getInst().getPhotoSavedPath() + "/" + picName, false, bitmap);

      } catch (Exception e) {
        e.printStackTrace();
        toast("图片处理错误,请退出相机并重试", Toast.LENGTH_LONG);
      }
      return fileName;
    }