当前位置: 首页>>代码示例>>Java>>正文


Java CropImageView类代码示例

本文整理汇总了Java中com.isseiaoki.simplecropview.CropImageView的典型用法代码示例。如果您正苦于以下问题:Java CropImageView类的具体用法?Java CropImageView怎么用?Java CropImageView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CropImageView类属于com.isseiaoki.simplecropview包,在下文中一共展示了CropImageView类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onPostExecute

import com.isseiaoki.simplecropview.CropImageView; //导入依赖的package包/类
protected void onPostExecute(final Bitmap[] bitmap) {

            if (bitmap == null) {
                mProgressDialog.dismiss();
                return;
            }

            if (mPreviewPlanetMaker != null)
                mPreviewPlanetMaker.setInputImage(bitmap[0], mIsPano);

            CropImageView view = (CropImageView) findViewById(R.id.cropImageView);
            view.setImageBitmap(bitmap[1]);
            tabFragment.resetCropView(mIsPano);
            // The image view is initialized with a fixed height in order to show the 'gray planet' in a nice manner. Now we need to undo this initialization:
            //                        mImageView.getLayoutParams().height = LayoutParams.MATCH_PARENT;
            updateImageView();
            checkFirstTimeImageOpen();

            mProgressDialog.dismiss();

        }
 
开发者ID:hollaus,项目名称:TinyPlanetMaker,代码行数:22,代码来源:MainActivity.java

示例2: cropImage

import com.isseiaoki.simplecropview.CropImageView; //导入依赖的package包/类
@OnClick({R.id.btn_9_16, R.id.btn_3_4, R.id.btn_1_1, R.id.btn_4_3, R.id.btn_16_9})
void cropImage(View v) {
    switch (v.getId()) {
        case R.id.btn_9_16:
            mCropImageView.setCropMode(CropImageView.CropMode.RATIO_9_16);
            setRationSelected(0);
            break;
        case R.id.btn_3_4:
            mCropImageView.setCropMode(CropImageView.CropMode.RATIO_3_4);
            setRationSelected(1);
            break;
        case R.id.btn_1_1:
            mCropImageView.setCropMode(CropImageView.CropMode.RATIO_1_1);
            setRationSelected(2);
            break;
        case R.id.btn_4_3:
            mCropImageView.setCropMode(CropImageView.CropMode.RATIO_4_3);
            setRationSelected(3);
            break;
        case R.id.btn_16_9:
            mCropImageView.setCropMode(CropImageView.CropMode.RATIO_16_9);
            setRationSelected(4);
            break;
    }
}
 
开发者ID:LegendKe,项目名称:MyTravelingDiary,代码行数:26,代码来源:CropImageActivity.java

示例3: bindViews

import com.isseiaoki.simplecropview.CropImageView; //导入依赖的package包/类
private void bindViews(View view) {
    mCropView = (CropImageView) view.findViewById(R.id.cropImageView);
    view.findViewById(R.id.buttonDone).setOnClickListener(btnListener);
    view.findViewById(R.id.buttonFitImage).setOnClickListener(btnListener);
    view.findViewById(R.id.button1_1).setOnClickListener(btnListener);
    view.findViewById(R.id.button3_4).setOnClickListener(btnListener);
    view.findViewById(R.id.button4_3).setOnClickListener(btnListener);
    view.findViewById(R.id.button9_16).setOnClickListener(btnListener);
    view.findViewById(R.id.button16_9).setOnClickListener(btnListener);
    view.findViewById(R.id.buttonFree).setOnClickListener(btnListener);
    view.findViewById(R.id.buttonPickImage).setOnClickListener(btnListener);
    view.findViewById(R.id.buttonRotateLeft).setOnClickListener(btnListener);
    view.findViewById(R.id.buttonRotateRight).setOnClickListener(btnListener);
    view.findViewById(R.id.buttonCustom).setOnClickListener(btnListener);
    view.findViewById(R.id.buttonCircle).setOnClickListener(btnListener);
    view.findViewById(R.id.buttonShowCircleButCropAsSquare).setOnClickListener(btnListener);
    mRootLayout = (LinearLayout) view.findViewById(R.id.layout_root);
}
 
开发者ID:asifali22,项目名称:Focus-Android-App,代码行数:19,代码来源:MainFragment.java

示例4: bindViews

import com.isseiaoki.simplecropview.CropImageView; //导入依赖的package包/类
private void bindViews(View view) {
  mCropView = (CropImageView) view.findViewById(R.id.cropImageView);
  view.findViewById(R.id.buttonDone).setOnClickListener(btnListener);
  view.findViewById(R.id.buttonFitImage).setOnClickListener(btnListener);
  view.findViewById(R.id.button1_1).setOnClickListener(btnListener);
  view.findViewById(R.id.button3_4).setOnClickListener(btnListener);
  view.findViewById(R.id.button4_3).setOnClickListener(btnListener);
  view.findViewById(R.id.button9_16).setOnClickListener(btnListener);
  view.findViewById(R.id.button16_9).setOnClickListener(btnListener);
  view.findViewById(R.id.buttonFree).setOnClickListener(btnListener);
  view.findViewById(R.id.buttonPickImage).setOnClickListener(btnListener);
  view.findViewById(R.id.buttonRotateLeft).setOnClickListener(btnListener);
  view.findViewById(R.id.buttonRotateRight).setOnClickListener(btnListener);
  view.findViewById(R.id.buttonCustom).setOnClickListener(btnListener);
  view.findViewById(R.id.buttonCircle).setOnClickListener(btnListener);
  view.findViewById(R.id.buttonShowCircleButCropAsSquare).setOnClickListener(btnListener);
}
 
开发者ID:IsseiAoki,项目名称:SimpleCropView,代码行数:18,代码来源:BasicFragment.java

示例5: onSampleSelected

import com.isseiaoki.simplecropview.CropImageView; //导入依赖的package包/类
@Override
public void onSampleSelected(int id) {

    int imageId = -1;

    switch (id) {
        case R.id.vienna_imagebutton:
            imageId = R.drawable.vienna_1000;
            break;
        case R.id.rome_imagebutton:
            imageId = R.drawable.rome_1000;
            break;
        case R.id.nancy_imagebutton:
            imageId = R.drawable.nancy_1000;
            break;
    }

    resetPlanetValues();

    Bitmap bitmap = BitmapFactory.decodeResource(getResources(), imageId);

    //                TODO: use a resized version here:
    CropImageView view = (CropImageView) findViewById(R.id.cropImageView);
    view.setImageBitmap(bitmap);
    tabFragment.resetCropView(true);

    mPreviewPlanetMaker.setInputImage(bitmap, true);
    updateImageView();

    checkFirstTimeImageOpen();

}
 
开发者ID:hollaus,项目名称:TinyPlanetMaker,代码行数:33,代码来源:MainActivity.java

示例6: createCropTab

import com.isseiaoki.simplecropview.CropImageView; //导入依赖的package包/类
private void createCropTab(final LayoutInflater inflater, final ViewGroup container) {
    TabHost.TabSpec spec;

    spec = mTabHost.newTabSpec(getString(R.string.crop_tab));
    spec.setIndicator(createTabView(inflater, container, getString(R.string.crop_title)));

    spec.setContent(new TabHost.TabContentFactory() {

        @Override
        public View createTabContent(String tag) {

            View view = inflater.inflate(R.layout.fragment_crop, container, false);

            mCropView = (CropImageView) view.findViewById(R.id.cropImageView);
            mCropView.setCropCallback(new CropCallback() {
                @Override
                public void onSuccess(Bitmap cropped) {

                }

                @Override
                public void onError() {

                }
            });

            mCropView.setOnTouchListener(new View.OnTouchListener() {
                @Override
                public boolean onTouch(View v, MotionEvent event) {

                    if (v == null)
                        return false;

                    CropImageView cropView = (CropImageView) v;

                    // cropView.getActualCropRect() causes nullpointer exceptions when no image is loaded:
                    if (cropView.getImageBitmap() == null)
                        return false;

                    if (cropView.getActualCropRect() == null)
                        return false;

                    RectF rect = cropView.getActualCropRect();

                    float left = rect.left / (float) cropView.getImageBitmap().getWidth();
                    float right = rect.right / (float) cropView.getImageBitmap().getWidth();
                    float top = rect.top / (float) cropView.getImageBitmap().getHeight();
                    float bottom = rect.bottom / (float) cropView.getImageBitmap().getHeight();
                    RectF normedRect = new RectF(left, top, right, bottom);

                    mPlanetChangeCallBacks.onCrop(normedRect);

                    return false;
                }
            });

            mFadeSwitch = (android.support.v7.widget.SwitchCompat) view.findViewById(R.id.fade_switch);
            enableFadeSwitchListener();

            return (view);

        }
    });

    mTabHost.addTab(spec);
}
 
开发者ID:hollaus,项目名称:TinyPlanetMaker,代码行数:67,代码来源:TabFragment.java

示例7: resetCropView

import com.isseiaoki.simplecropview.CropImageView; //导入依赖的package包/类
public void resetCropView(boolean isPano) {
        mFadeSwitch.setChecked(!isPano);
//        float left = ((CropImageView) v).getActualCropRect().left / (float)((CropImageView) v).getImageBitmap().getWidth();
        mCropView.setCropMode(CropImageView.CropMode.FIT_IMAGE);
    }
 
开发者ID:hollaus,项目名称:TinyPlanetMaker,代码行数:6,代码来源:TabFragment.java

示例8: onClick

import com.isseiaoki.simplecropview.CropImageView; //导入依赖的package包/类
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.buttonDone:
            // Get cropped bitmap and pass it to Application
            showProgress();
            mCropView.startCrop(createSaveUri(), mCropCallback, mSaveCallback);
            break;
        case R.id.buttonFitImage:
            mCropView.setCropMode(CropImageView.CropMode.FIT_IMAGE);
            break;
        case R.id.button1_1:
            mCropView.setCropMode(CropImageView.CropMode.SQUARE);
            break;
        case R.id.button3_4:
            mCropView.setCropMode(CropImageView.CropMode.RATIO_3_4);
            break;
        case R.id.button4_3:
            mCropView.setCropMode(CropImageView.CropMode.RATIO_4_3);
            break;
        case R.id.button9_16:
            mCropView.setCropMode(CropImageView.CropMode.RATIO_9_16);
            break;
        case R.id.button16_9:
            mCropView.setCropMode(CropImageView.CropMode.RATIO_16_9);
            break;
        case R.id.buttonCustom:
            mCropView.setCustomRatio(7, 5);
            break;
        case R.id.buttonFree:
            mCropView.setCropMode(CropImageView.CropMode.FREE);
            break;
        case R.id.buttonCircle:
            mCropView.setCropMode(CropImageView.CropMode.CIRCLE);
            break;
        case R.id.buttonShowCircleButCropAsSquare:
            mCropView.setCropMode(CropImageView.CropMode.CIRCLE_SQUARE);
            break;
        case R.id.buttonRotateLeft:
            mCropView.rotateImage(CropImageView.RotateDegrees.ROTATE_M90D);
            break;
        case R.id.buttonRotateRight:
            mCropView.rotateImage(CropImageView.RotateDegrees.ROTATE_90D);
            break;

        case R.id.buttonPickImage:
            pickImage();
            break;
    }
}
 
开发者ID:asifali22,项目名称:Focus-Android-App,代码行数:51,代码来源:MainFragment.java

示例9: onClick

import com.isseiaoki.simplecropview.CropImageView; //导入依赖的package包/类
@Override public void onClick(View v) {
  switch (v.getId()) {
    case R.id.buttonDone:
      BasicFragmentPermissionsDispatcher.cropImageWithCheck(BasicFragment.this);
      break;
    case R.id.buttonFitImage:
      mCropView.setCropMode(CropImageView.CropMode.FIT_IMAGE);
      break;
    case R.id.button1_1:
      mCropView.setCropMode(CropImageView.CropMode.SQUARE);
      break;
    case R.id.button3_4:
      mCropView.setCropMode(CropImageView.CropMode.RATIO_3_4);
      break;
    case R.id.button4_3:
      mCropView.setCropMode(CropImageView.CropMode.RATIO_4_3);
      break;
    case R.id.button9_16:
      mCropView.setCropMode(CropImageView.CropMode.RATIO_9_16);
      break;
    case R.id.button16_9:
      mCropView.setCropMode(CropImageView.CropMode.RATIO_16_9);
      break;
    case R.id.buttonCustom:
      mCropView.setCustomRatio(7, 5);
      break;
    case R.id.buttonFree:
      mCropView.setCropMode(CropImageView.CropMode.FREE);
      break;
    case R.id.buttonCircle:
      mCropView.setCropMode(CropImageView.CropMode.CIRCLE);
      break;
    case R.id.buttonShowCircleButCropAsSquare:
      mCropView.setCropMode(CropImageView.CropMode.CIRCLE_SQUARE);
      break;
    case R.id.buttonRotateLeft:
      mCropView.rotateImage(CropImageView.RotateDegrees.ROTATE_M90D);
      break;
    case R.id.buttonRotateRight:
      mCropView.rotateImage(CropImageView.RotateDegrees.ROTATE_90D);
      break;
    case R.id.buttonPickImage:
      BasicFragmentPermissionsDispatcher.pickImageWithCheck(BasicFragment.this);
      break;
  }
}
 
开发者ID:IsseiAoki,项目名称:SimpleCropView,代码行数:47,代码来源:BasicFragment.java

示例10: onClick

import com.isseiaoki.simplecropview.CropImageView; //导入依赖的package包/类
@Override public void onClick(View v) {
  switch (v.getId()) {
    case R.id.buttonDone:
      mDisposable.add(cropImage());
      break;
    case R.id.buttonFitImage:
      mCropView.setCropMode(CropImageView.CropMode.FIT_IMAGE);
      break;
    case R.id.button1_1:
      mCropView.setCropMode(CropImageView.CropMode.SQUARE);
      break;
    case R.id.button3_4:
      mCropView.setCropMode(CropImageView.CropMode.RATIO_3_4);
      break;
    case R.id.button4_3:
      mCropView.setCropMode(CropImageView.CropMode.RATIO_4_3);
      break;
    case R.id.button9_16:
      mCropView.setCropMode(CropImageView.CropMode.RATIO_9_16);
      break;
    case R.id.button16_9:
      mCropView.setCropMode(CropImageView.CropMode.RATIO_16_9);
      break;
    case R.id.buttonCustom:
      mCropView.setCustomRatio(7, 5);
      break;
    case R.id.buttonFree:
      mCropView.setCropMode(CropImageView.CropMode.FREE);
      break;
    case R.id.buttonCircle:
      mCropView.setCropMode(CropImageView.CropMode.CIRCLE);
      break;
    case R.id.buttonShowCircleButCropAsSquare:
      mCropView.setCropMode(CropImageView.CropMode.CIRCLE_SQUARE);
      break;
    case R.id.buttonRotateLeft:
      mCropView.rotateImage(CropImageView.RotateDegrees.ROTATE_M90D);
      break;
    case R.id.buttonRotateRight:
      mCropView.rotateImage(CropImageView.RotateDegrees.ROTATE_90D);
      break;
    case R.id.buttonPickImage:
      pickImage();
      break;
  }
}
 
开发者ID:IsseiAoki,项目名称:SimpleCropView,代码行数:47,代码来源:RxFragment.java


注:本文中的com.isseiaoki.simplecropview.CropImageView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。