uiimageview

Erasing part of an image that overlaps with text from a UILabel

泄露秘密 提交于 2019-12-04 17:23:50
I have it where a user can move an image and uilabel around the screen. Say it is a black image and black text. I want the portion of the text that overlaps with the image to become transparent so that the background shows through and you can still read the text even though they were originally the same color. Hopefully this makes sense. I've found some links on erasing with touch. I'm not sure how to go about automating this with the portion of the text that overlaps. Maybe something like this "Masking an image with an image"? https://developer.apple.com/library/mac/#documentation

iPhone/Xcode: UIImage and UIImageView won't get with the program

时光毁灭记忆、已成空白 提交于 2019-12-04 17:23:15
I am attempting to save and load a UIImage to and from the iPhone documents directory after the image is picked from the iPhone Photo Library. It is able to do so, but for some reason, when I load the image, it rotates it 90 degrees counterclockwise. Here is my saveImage and loadImage methods: Save Image: - (void)saveImage: (UIImage*)image{ if (image != nil) { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString* path = [documentsDirectory stringByAppendingPathComponent: [NSString

tesseract OCR in iphone application

笑着哭i 提交于 2019-12-04 17:10:06
I am using tesseract open source engine for OCR to read text from image. But I didn't get 100% result for a single time. Please give your suggestions about quality improvement for OCR using tesseract. Thanks here is how to get best result from tesseract Please make sure that you have done preprocessing on image. OVR will produce best results for the images which have following properties: fix DPI (if needed) 300 DPI is minimum fix text size (e.g. 12 pt should be ok) try to fix text lines (deskew and dewarp text) try to fix illumination of image (e.g. no dark part of image binarize and de-noise

How to zoom into a selected area of image in iPhone?

别说谁变了你拦得住时间么 提交于 2019-12-04 16:56:37
I have an ImageView when clicked on that imageview, transparent circle should be created and again when double clicking on that circle, particular Image in that circle area should be zoomed.Any suggestion would be appreciated. sandy I think this code will helpfull to you - (id)initWithImage:(UIImage *)image { self = [super initWithImage:image]; if (self) { [self setUserInteractionEnabled:YES]; UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)]; UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc]

UIImageView's layer border visible inset

给你一囗甜甜゛ 提交于 2019-12-04 16:33:06
Just did this: self.imageView.backgroundColor = color1; self.imageView.layer.masksToBounds = YES; self.imageView.layer.borderColor = color1; self.imageView.layer.borderWidth = 3.0; Here is screenshot of the problem: I can see image, borders, and image fragments out of the border… How can I fix it? I had a similar issue using the border properties on the layer and managed to solve it by adding a CAShapeLayer on top. I can't tell you how it will behave on older devices as haven't tested it with many animations and so on, but I really doubt it will slow them down. Here is some code in Swift:

How do you tell what object is being touched in touchesBegan?

浪尽此生 提交于 2019-12-04 16:22:18
问题 I know that this is a very commonly asked question, but all of the answers on every website don't work! If you still don't know what I mean, then maybe this line of code will help you understand. - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; CGPoint location = [touch locationInView:self.view]; if (touch.view == nextbutton) [self performSelector:@selector(next)]; if (touch.view == prevbutton) [self performSelector:@selector

Resize UILabel correct on top of UIImageView

纵饮孤独 提交于 2019-12-04 16:09:09
My problem is as follows: I have on top of a UIImageView some labels. The image is a formular and the UILabel s represents the entries. If I rotate the device the image inside UIImageView gets resized with option "aspect fit". How can I achieve that the UILabel is also resized and aligned correct? The normal options for resizing aren't working as needed. The UIImageView is zoomable with minimumZoomScale and maximumZoomScale set. Thanks. You can resize a UILabel proportionally using: label.transform = CGAffineTransformMakeScale(0.5, 0.5); You can reposition a UILabel relatively using: label

UIImagePickerController Save to Disk then Load to UIImageView

不打扰是莪最后的温柔 提交于 2019-12-04 16:07:26
I have a UIImagePickerController that saves the image to disk as a png. When I try to load the PNG and set a UIImageView's imageView.image to the file, it is not displaying. Here is my code: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; NSData *imageData = UIImagePNGRepresentation(image); // Create a file name for the image NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setTimeStyle:NSDateFormatterShortStyle];

UITableViewCell asynchronously loading images issue - Swift

强颜欢笑 提交于 2019-12-04 15:07:20
问题 In my app, I built my own asynchronous image loading class. I pass in a object, then it checks if the cache (NSCache) has the image, if not it will then check the file system if the image is saved already. If the image is not saved already, it will then download the image in the background (NSOperations help). This works great so far, but I have ran into a few small issues with the table view loading the images. First off, this is the function I use to set up the table view cell from

iOS curl up animation to remove uiimageview

混江龙づ霸主 提交于 2019-12-04 14:45:47
i'm looking to remove an image from my app with a curl up animation. I've got [UIView transitionWithView:sender.view.superview duration:1.5 options:UIViewAnimationOptionTransitionCurlUp animations:^ { [sender.view removeFromSuperview]; } completion:nil]; but this curls the entire page away and looks as though there's a separate page beneath without the image on it. Instead of a 'transition' to a new page is it possible to curl the image off the page without affecting the rest of the page? Do I need to wrap the imageview in a 'container view' and change transition with view to that? Your view