uiimageview

Use Layer Mask to make parts of the UIView transparent?

馋奶兔 提交于 2019-12-08 03:28:18
问题 I have a UIViewController with a background color red of its self.view . I want to place a UIImageView in the center of the screen. The UIImageView show cover the entire screen and its background color should be blue. There should be a 100 x 100 image in the center when acts as mask. The image is a png with transparent and non transparent parts. Using this image as mask the background should be visible through the non transparent parts of this png. It should look like this: Here is a demo how

UIViewContentModeScaleAspectFit iphone sdk gives poor quality image

假装没事ソ 提交于 2019-12-08 03:23:47
问题 Hopefully a quick one? I am creating a custom uitableviewcell and have added an imageview. I have some PNG images which are around 200x200 in size. I want to create a thumbnail to put in the tableview, but when I resize the image, it results in a poor quality image. I use UIViewContentModeScaleAspectFit to resize it to a 50x50 frame. Should I be calling a better draw resize on each image before I Put it to the table cell? There will be around 20-40 images in each table, so I don't want to

Convert UIScrollViewPoint to UIImage + ZOOM + ROTATE

佐手、 提交于 2019-12-08 03:22:04
问题 I need to crop UIImage which is loaded in UIScrollview with some rect of Another UIView which is also in UIScrollView Following is View Hierarchy --> View --> UIScrollView --> viewBase (UIView) --> UIImageView -> (Zoomed & rotated ) --> UIView (Target View)(Movable User can move anywhere in scrollview to crop rect) My Image is Rotated & Zoomed I need to get exact part of image in TargetView I am drawing UIImage with rotation on context following is code CGFloat angleCroppedImageRetreacted =

Taking Screenshot of UIImageView I need only image IOS

落花浮王杯 提交于 2019-12-08 03:06:10
问题 In my IOS App I am taking screenshot of UIImageView. It's very perfect as shown in attachment Photo. But here, I have taken UIImageView content mode aspect fit . I've used this code. func captureView() -> UIImage { UIGraphicsBeginImageContextWithOptions(imageView.bounds.size, false,UIScreen.mainScreen().scale)//add this line let context: CGContextRef = UIGraphicsGetCurrentContext()! self.backView.layer.renderInContext(context) let img: UIImage = UIGraphicsGetImageFromCurrentImageContext()

UIBezierPath undo drawing redraw UIImageView's image

妖精的绣舞 提交于 2019-12-08 02:54:05
问题 I'm trying to redraw my UIImageView's image by redrawing all UIBezierPaths and associated UIColors in an NSMutableArray I have created, minus the last path when I tap an undo UIButton. However, the UIImageView's image doesn't redraw and remove the last path in this case, until the NSMutableArray's count is less than 2, in which it sets the UIImageView's image to nil (this is working correctly) I'd appreciate any help offered. Note: I'm not including my touchesMoved method because I just want

IOS: How to split an UIImage into parts

泪湿孤枕 提交于 2019-12-08 02:45:40
In one of my application I need to split UIImage into multiple parts. The following was the code I am using to split. Here my problem is I am unable to load the image view by adding the image to UIImageView. - (void)viewDidLoad { UIImage* image = [UIImage imageNamed:@"monalisa.png"]; NSMutableArray* splitImages = [self splitImageIntoRects:(__bridge CGImageRef)(image)]; printf("\n count; %d",[splitImages count]); CALayer *layer = [splitImages objectAtIndex:5]; CGImageRef imgRef = (__bridge CGImageRef)(layer.contents); UIImage *img = [[UIImage alloc] initWithCGImage:imgRef]; UIImageView*

CIGaussianBlur changes imageOrientation sometime

安稳与你 提交于 2019-12-08 01:20:18
问题 In my iOS app I want to apply a filter CIGaussianBlur on UIImage, when it gets a image having big height it rotates the image CIContext *context = [CIContext contextWithOptions:nil]; CIImage *inputImage = [[CIImage alloc] initWithImage:image]; //get image for blur CIFilter *blurFilter = [CIFilter filterWithName:@"CIGaussianBlur"]; [blurFilter setDefaults]; [blurFilter setValue:inputImage forKey:@"inputImage"]; CGFloat blurLevel = 0.0f; // Set blur level [blurFilter setValue:[NSNumber

Why are image views sometimes not appearing in collection view cells?

半腔热情 提交于 2019-12-08 00:10:23
问题 I just updated to Swift 3. My collection views were working great before the update. I did the recommended changes to make the compiler happy, but now I'm having this problem. Image views that are in my custom UICollectionViewCells are simply not appearing anymore. Neither programmatically generated image views nor prototype image views are appearing. I've given the image views background colors to check if my images are nil. The background colors aren't appearing, so it is safe to assume the

UIButton position while UIImage zoom on UIScrollView

夙愿已清 提交于 2019-12-07 23:49:00
问题 I have a scenario where I need to implement an Offline Map concept for which I am using the image of map on a UIScrollView that zooms on PinchGesture, which works fine. Problem I have a UIButton on map. While zooming, the button does not track its position with respect to UIImageView which is being scaled.I am able to reframe the button without affecting its size. But the position is wrong. TLDR , I need to reproduce the mapView with annotation kinda concept on UIScrollView with UIImage on it

Memory management when adding a UIImageView to another viewController's view from another viewController's view

这一生的挚爱 提交于 2019-12-07 22:07:21
问题 So it looks like I have no leaks detected throughout my entire project, and I have lots of sections that do various things. However, I found that I am having some allocation issues, proven to me with mark heap in leaks instrument, which have happened most of the time when using the iPad with an external screen. The app is programmed to behave differently when connected to an external screen. I have a zoomable UIScrollView map section that I can go in and out of. When using the iPad by itself,