uiimageview

Detect pixel collision/overlapping between two images

别来无恙 提交于 2019-12-23 12:38:42
问题 I have two UIImageViews that contain images with some transparent area. Is there any way to check if the non-transparent area between both images collide? Thanks. [UPDATE] So this is what I have up until now, unfortunately it still ain't working but I can't figure out why. if (!CGRectIntersectsRect(frame1, frame2)) return NO; NSLog(@"OverlapsPixelsInImage:withImage:> Images Intersect"); UIImage *img1 = imgView1.image; UIImage *img2 = imgView2.image; CGImageRef imgRef1 = [img1 CGImage];

How do I fade the corners/edges/borders of a UIImageView

这一生的挚爱 提交于 2019-12-23 12:29:01
问题 I was unable to find this on the forums so I decided to post this. I have a UIImageView with the following code which fades the images from one another. - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)]; imageNames = [NSArray arrayWithObjects:@"image1.jpg", @"image2.jpg", @"image3.jpg"

UIImageView animations lag at first run

那年仲夏 提交于 2019-12-23 12:16:35
问题 I have a series of images that play in my application (it's only got one view/viewcontroller). Whenever I run the app, the first time I play an animation, it will lag a bit the first time the animation is told to play. I run my animations via different methods (e.g. "animateJump") which are responsible for loading the correct frames, then playing the animation. After the animation finishes, I (supposedly) release the animation from the UIImageView, putting back a single frame to display. (I

How to send image from framework to sample project in iOS Swift?

十年热恋 提交于 2019-12-23 10:03:16
问题 I have implemented document scanner using visionKit. Initially i have faced camera dismiss issue and it fixed. Now i am trying to send image after camera dismiss from framework to sample project. I have tried using completion handler, but it does not work. Here is the code for framework: public class A8Scan: NSObject, VNDocumentCameraViewControllerDelegate { var imageNew: UIImage? var statusImage: UIImageView? private var clientView: UIViewController? public init(_ viewController

cameraOverlayView problem on iOS 4.3

江枫思渺然 提交于 2019-12-23 08:07:31
问题 I'm using an picker Controller with a cameraOverlayView to display an image of a product in the camera view. The product image is resized before applying on the overlay. It works fine on iOS 4.2 but on iOS 4.3 the product image is displayed full size. pickerController.sourceType = UIImagePickerControllerSourceTypeCamera; UIImageView *imgView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:produitAffiche.img_realite]] autorelease]; // Resize if(imgView.frame.size.height == 480) { /

iOS blend mode multiply

夙愿已清 提交于 2019-12-23 08:05:04
问题 I'm looking for a solution to create this red box: It is using a color filter 'Multiply'. Currently I have found this information: https://developer.apple.com/library/mac/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_images/dq_images.html But how can I use something like the multiply effect on a UIView or isn't this possible? So that the background is a UIImageView and the red box is a UIView with the multiply effect. 回答1: This Swift extension did the trick for me. extension

UIImageView content mode

ぐ巨炮叔叔 提交于 2019-12-23 07:29:07
问题 The blue line is the imageview's bounds. UIImageView 's contentMode is UIViewContentModeScaleAspectFit , And I want keep the original picture's scale. How can I make the picture's left edge is on the UIImageView 's left edge? But not like UIViewContentModeTopLeft mode. Keep the scale and no blank in the left. My english is not good, hope you guys could understand what I'm saying. Thank you very much. 回答1: yourimageView.contentMode = UIViewContentModeCenter; if ( yourimageView.bounds.size

UIImagePickerControllerEditedImage edited image offset for iOS 11

家住魔仙堡 提交于 2019-12-23 07:26:56
问题 I'm using a UIImagePickerController with allowsEditing enabled to share images in an App, but found that cropped image is offset for devices running iOS 11 only. My UIImagePickerControllerDelegate implementation is quite simple, just standard actions: func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { let image = info[UIImagePickerControllerEditedImage] as! UIImage imageView.image = image picker.dismiss(animated: true,

UIImageView Recognizer

半世苍凉 提交于 2019-12-23 06:29:29
问题 In my app I have a big UIImageView and other 5 smaller. My intention is to copy the content of the selected small Image to the biggest one. Also to get the name of the chosen image and show with a UILabel. Will be maybe easier to replace the small images by UIButtons and display the image as a background? 回答1: I would add a gestureRecognizer to each imageView. The function called by the gestureRecognizer would then change the image on the "big picker view". There is no built-in way to get the

Loading many UIImages from disk blocks main thread

混江龙づ霸主 提交于 2019-12-23 06:21:07
问题 I have a group of local UIImage s that I need to load and present in successive order when their respective cell is tapped. For example, I have 20 images of a hot dog that combine to form an animation. When the user taps the hot dog cell, the cell's UIImageView should animate the images. I know how to use UIImageView 's animationImages to achieve the animation. My problem is that retrieving all of these images from disk takes ~1.5 seconds and blocks the main thread. I could instantiate a