iOS/Objective C image alpha low when I goes out of bounds of parent image -
i have image editing ios app.
i have t-shirt(parent image) image background image , can add other image(sub images) t-shirt image.
when scale, move, rotate sub images meanwhile if portion of image going out of bounds of parent image portion should low alpha value.
similarly i’ve shown in screenshot.
i’ve wrote following code.
uiimageview* randomview = [[uiimageview alloc] initwithframe:self.imageview.bounds]; randomview.userinteractionenabled = yes; randomview.alpha = 0.8; randomview.image = image; // 'image' coming gallery or camera uiimageview *maskview = [[uiimageview alloc] initwithimage:self.imageview.image]; [maskview setframe:self.imageview.bounds]; self.imageview.layer.mask = maskview.layer; [self.imageview setneedsdisplay];
add 1 more imageview (copy of main image alpha) behind t-shirt view.
Comments
Post a Comment