uiimageview

Overlaying 2D paths on UIImage without scaling artifacts

被刻印的时光 ゝ 提交于 2020-01-06 05:18:17
问题 I need to draw a path along the shape of an image in a way that it is always matching its position on the image independent of the image scale. Think of this like the hybrid view of Google Maps where streets names and roads are superimposed on top of the aerial pictures. Furthermore, this path will be drawn by the user's finger movements and I need to be able to retrieve the path keypoints on the image pixel coordinates. The user zooms-in in order to more precisely set the paths location. I

Not Detecting Tap on image view

ぃ、小莉子 提交于 2020-01-06 04:51:54
问题 I have an application in which i am calling image from URL in image view. Image view is add as subview of scroll view. In my implementation file i have use this code - (void)loadView { [super loadView]; // add gesture recognizers to the image view UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)]; UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)];

Saving Image from UIImageView after manipulating Gestures

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-06 03:36:06
问题 I'm trying to save the image after manipulating it with move, pinch and rotate gestoures. All I get is the real image no matter what I tried, I tried with UIGraphicsBeginImageContextWithOptions on the UIView container and on the UIIMageView without success. Hope someone can help on this one. Thanks, Itay 回答1: You could try with this: UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0.0); CGContextConcatCTM(UIGraphicsGetCurrentContext(), imageView.transform); [imageView.layer

Rotate UIImage and Move

这一生的挚爱 提交于 2020-01-06 03:18:07
问题 I have searched stack overflow too many times and also posted a question but in vain. I need to implement a function in my collage app where user can rotate a uiimage and move it as rotated image. Any idea of how to do it? I will try all of them if needed. Am being frustrated searching for it for last two days. At first i have rotated the frame of the UIImage using CGAffineTransformMakeRotation(angle). It was working but when moving the image after rotation, it was creating distortion. So any

How to use CIDetector and CIFaceFeature with large images and different aspect ratios

南笙酒味 提交于 2020-01-06 02:55:08
问题 I've been working on this for days and all examples out there are if the image size is the same as the UIImageView. In addition, a lot of the answered on Stack are outdated. I have an app where the user can add an image, which can be of any size, and different aspect ratio, for example 750X750, 1280X920. The UIImageView is smaller of course, and the content mode is set to Aspect Fill. I did a lot of testing so this is what I have done so far: I convert the CoreImage coordinates to UIKit using

UIGraphicsGetImageFromCurrentImageContext() crashes the app on iPad 3

ⅰ亾dé卋堺 提交于 2020-01-05 17:49:10
问题 My problem is when I assign the image which was returned by the UIGraphicsGetImageFromCurrentImageContext() , to the UIImageView more than once, my app crashes. Here is my code: If omit the assignment line of UIImageView app will not crash. UIImage * newImage3; UIGraphicsBeginImageContext(duplicateImage.size); [duplicateImage drawAtPoint:CGPointMake(0, 0)]; context2=UIGraphicsGetCurrentContext(); for(int k=0; k<kmtaGroup->TotalLines; k++) { lineObject=&kmtaGroup->Line_INFO_OBJ[k]; x0 =

Collection View Cell does not display image in image view

非 Y 不嫁゛ 提交于 2020-01-05 13:56:12
问题 I am trying to create a simple gallery for an iOS application. I'm working with a UICollectionView inside of a ViewController. Everything seems to be working fine, but I can't get the image I'm trying to use to display inside of the collection view cell. I will just dump some code here, I have been desperate to find a solution but nothing seems to work. This is the gallery.m file: -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView; { //just a random value for

Make image accessible from other ViewController

痞子三分冷 提交于 2020-01-05 12:09:23
问题 I just want to know the code for making an image called profpic accessible to all other ViewControllers that I make or intend to make. I have read many posts on global variables, public variables, and other suggestions that have yet to work. If it helps, I am specifically using this to display an image from ViewControllerA as the background for ViewControllerB . 回答1: You can use a singleton class and put the UIImage on it. Set it in ViewControllerA and get it in ViewControllerB @interface

Move image from left to right and right to left in iphone

一笑奈何 提交于 2020-01-05 07:10:54
问题 - (void)moveImage:(UIImageView *)image duration:(NSTimeInterval)duration curve:(int)curve x:(CGFloat)x y:(CGFloat)y { // Setup the animation [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:duration]; [UIView setAnimationCurve:curve]; [UIView setAnimationBeginsFromCurrentState:YES]; // The transform matrix CGAffineTransform transform = CGAffineTransformMakeTranslation(x, y); image.transform = transform; // Commit the changes [UIView commitAnimations]; } - (void

Loading image from URL on iPhone

强颜欢笑 提交于 2020-01-05 04:15:29
问题 I have no idea why this isn't working. NSData *data = [NSData dataWithContentsOfURL:place.iconData]; UIImage *image = [UIImage imageWithData:data]; [imageView setImage:image]; imageView is an IBOutlet hooked up through IB. place.iconData is http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png. For some reason, though, it won't load. Any help is much appreciated. 回答1: Is your data being freed before it got assigned? Maybe try manually allocating memory for the NSData: