【发布时间】:2016-11-03 12:12:19
【问题描述】:
我正在开发一个 iOS 应用程序(目标 C),我需要在其中处理 图像操作。
应用模块中要做的功能是,
获取您要编辑的任何图像(父图像)。然后将其他图像(如明喻、表情符号、贴纸)放入该图像中。子图像应在父图像范围内可缩放、可旋转、可拖动。
我成功管理了子图像的缩放、旋转、拖动效果。
但问题是,在缩放、旋转、拖动子图像的过程中,位于父图像之外的图像部分会变得模糊或低于父图像内部的图像部分的 alpha 值.
我附上了我正在寻找的输出的参考屏幕截图。
This is the reference image of the output, I am looking for
编辑:这里是代码 sn-p。
UIImageView* randomView = [[UIImageView alloc] initWithFrame:CGRectMake(130, 200, 100, 100)];
randomView.image = image; //image coming from gallery
randomView.userInteractionEnabled = YES;
randomView.alpha = 0.8;
imageView.backgroundColor = [UIColor clearColor];
imageView.opaque = NO;
randomView.backgroundColor = [UIColor clearColor];
randomView.opaque = NO;
[self addPanGesture:randomView];
[self addPinchGesture:randomView];
[self addRotateGesture:randomView];
[imageView addSubview:randomView];
【问题讨论】:
-
提供您的代码和有关实施的更多详细信息,以便更好地理解问题。
-
试试这个:
self.imageView.clipToBounds = YES -
请查看代码视图的编辑。 @同志
标签: ios objective-c image uiimageview uiimage