本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}