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


Java UCrop.withMaxResultSize方法代码示例

本文整理汇总了Java中com.yalantis.ucrop.UCrop.withMaxResultSize方法的典型用法代码示例。如果您正苦于以下问题:Java UCrop.withMaxResultSize方法的具体用法?Java UCrop.withMaxResultSize怎么用?Java UCrop.withMaxResultSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.yalantis.ucrop.UCrop的用法示例。


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

示例1: startCropActivity

import com.yalantis.ucrop.UCrop; //导入方法依赖的package包/类
public static void startCropActivity(Activity context, Uri sourceUri,BasePhotoBuilder builder) {
    CropConfig config = buildCropConfig(builder);
    Uri mDestinationUri = buildUri(builder,false);
    UCrop uCrop = UCrop.of(sourceUri, mDestinationUri);

    uCrop.withAspectRatio(config.aspectRatioX,config.aspectRatioY);
    uCrop.withMaxResultSize(config.maxWidth,config.maxHeight);

    UCrop.Options options = new UCrop.Options();
    options.setCompressionFormat(Bitmap.CompressFormat.JPEG);
    options.setAllowedGestures(UCropActivity.SCALE,UCropActivity.NONE,UCropActivity.NONE);
    options.setCompressionQuality(config.quality);
    // options.setOvalDimmedLayer(config.isOval);
    options.setCircleDimmedLayer(config.isOval);
    options.setShowCropGrid(config.showGridLine);
    options.setHideBottomControls(config.hideBottomControls);
    options.setShowCropFrame(config.showOutLine);
    options.setToolbarColor(config.toolbarColor);
    options.setStatusBarColor(config.statusBarColor);

    uCrop.withOptions(options);

    uCrop.start(context);
}
 
开发者ID:hss01248,项目名称:PhotoOut,代码行数:25,代码来源:MyTool.java

示例2: startCropActivity

import com.yalantis.ucrop.UCrop; //导入方法依赖的package包/类
private static void startCropActivity(Activity context, Uri sourceUri) {
     Uri mDestinationUri = buildUri();
     UCrop uCrop = UCrop.of(sourceUri, mDestinationUri);

     uCrop.withAspectRatio(config.aspectRatioX,config.aspectRatioY);
     uCrop.withMaxResultSize(config.maxWidth,config.maxHeight);

     UCrop.Options options = new UCrop.Options();
     options.setCompressionFormat(Bitmap.CompressFormat.JPEG);
     options.setAllowedGestures(UCropActivity.SCALE,UCropActivity.NONE,UCropActivity.NONE);
     options.setCompressionQuality(config.quality);
     options.setOvalDimmedLayer(config.isOval);
     options.setShowCropGrid(config.showGridLine);
     options.setHideBottomControls(config.hideBottomControls);
     options.setShowCropFrame(config.showOutLine);
options.setToolbarColor(config.toolbarColor);
     options.setStatusBarColor(config.statusBarColor);

     uCrop.withOptions(options);

     uCrop.start(context);
 }
 
开发者ID:glassLake,项目名称:CropUtils,代码行数:23,代码来源:CropUtils.java

示例3: startCropActivity

import com.yalantis.ucrop.UCrop; //导入方法依赖的package包/类
private static void startCropActivity(Activity context, Uri sourceUri) {
     Uri mDestinationUri = buildUri();
     UCrop uCrop = UCrop.of(sourceUri, mDestinationUri);

     uCrop.withAspectRatio(config.aspectRatioX,config.aspectRatioY);
     uCrop.withMaxResultSize(config.maxWidth,config.maxHeight);

     UCrop.Options options = new UCrop.Options();
     options.setCompressionFormat(Bitmap.CompressFormat.JPEG);
     options.setAllowedGestures(UCropActivity.SCALE,UCropActivity.NONE,UCropActivity.NONE);
     options.setCompressionQuality(config.quality);
    // options.setOvalDimmedLayer(config.isOval);
     options.setCircleDimmedLayer(config.isOval);
     options.setShowCropGrid(config.showGridLine);
     options.setHideBottomControls(config.hideBottomControls);
     options.setShowCropFrame(config.showOutLine);
options.setToolbarColor(config.toolbarColor);
     options.setStatusBarColor(config.statusBarColor);

     uCrop.withOptions(options);

     uCrop.start(context);
 }
 
开发者ID:hss01248,项目名称:PicCrop,代码行数:24,代码来源:PicCrop.java

示例4: startForImageCrop

import com.yalantis.ucrop.UCrop; //导入方法依赖的package包/类
public static void startForImageCrop(final Provider provider, final Uri uri, int maxOutputWidth, int maxOutputHeight, final OnError onError, final @Nullable UCrop.Options options) {
    try {
        final UCrop.Options cropOptions = options != null
            ? options
            : new UCrop.Options();

        // Force JPEG format compression now while working out filename strategy.
        cropOptions.setCompressionFormat(Bitmap.CompressFormat.JPEG);

        final Context context = provider.getContext();

        //TODO: replace this with directly using a FileProvider URI once UCrop can handle it.
        final Uri destUri = Uri.fromFile(provider.getImageFile());

        final UCrop uCrop = UCrop.of(uri, destUri);
        uCrop.withOptions(cropOptions);
        uCrop.withMaxResultSize(maxOutputWidth, maxOutputHeight);

        final Intent intent = uCrop.getIntent(context);

        grantWriteAccessToURI(context, intent, destUri);

        startFor(provider, intent, RequestType.CROP.getCode());

    } catch (final IOException e) {

        onError.onError(e);
    }
}
 
开发者ID:mrkcsc,项目名称:android-media-picker,代码行数:30,代码来源:MediaPicker.java

示例5: basisConfig

import com.yalantis.ucrop.UCrop; //导入方法依赖的package包/类
private UCrop basisConfig(@NonNull UCrop uCrop) {
    return uCrop.withMaxResultSize(SAMPLE_IMAGE_MAX_SIZE_WIDTH,
            SAMPLE_IMAGE_MAX_SIZE_HEIGHT);
}
 
开发者ID:drakeet,项目名称:Lunei,代码行数:5,代码来源:TakePictureHelper.java


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