uiimageview

Animating UIImageView with colorWithPatternImage

岁酱吖の 提交于 2019-12-06 12:44:35
I have a UIImageView that is animated using the following code: NSMutableArray *imageArray = [[NSMutableArray alloc] init]; for(int i = 1; i < 15; i++) { NSString *str = [NSString stringWithFormat:@"marker_%i.png", i]; UIImage *img = [UIImage imageNamed:str]; if(img != nil) { [imageArray addObject:img]; } } _imageContainer.animationImages = imageArray; _imageContainer.animationDuration = 0.5f; [_imageContainer startAnimating]; What I want now is to repeat the image to get a pattern. There is colorWithPatternImage , but that isn't made for animations. I want the whole background filled with a

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

本小妞迷上赌 提交于 2019-12-06 11:41:03
问题 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

tesseract OCR in iphone application

邮差的信 提交于 2019-12-06 11:27:36
问题 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 回答1: 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

add subLayer to a imageView.layer

两盒软妹~` 提交于 2019-12-06 11:18:19
well I know that every imageViews have a layer (we can access it with :imageView.layer).I would like to use the layer of my imageView and add a subLayer to it's layer: shapeLayer (that is a CAShapeLayer) My code doesn't work, it doesn't show the shape layer! - (void)viewDidLoad { imageView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)]; [self.view addSubview:imageView]; } - (void)anotherMethod { [imageView.layer addSublayer:shapeLayer]; } How can I solve this please ? Try this: [outputImage.layer insertSublayer:shapeLayer atIndex:0]; I solved similar problem by using

Screen shot not provide image of whole screen

帅比萌擦擦* 提交于 2019-12-06 10:57:14
I am making application related to images. I have multiple images on my screen. I had take screen shot of that. But it should not provide my whole screen. Little part of the top most & bottom most part need not be shown in that. I have navigation bar on top. And some buttons at bottom. I don't want to capture that buttons and navigation bar in my screenshot image. Below is my code for screen shot. -(UIImage *) screenshot { UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, YES, [UIScreen mainScreen].scale); [self.view drawViewHierarchyInRect:self.view.frame afterScreenUpdates:YES];

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

北慕城南 提交于 2019-12-06 10:47:51
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, and checking the mark heap, the heap growth will eventually go down to 0 bytes, which is good. However

Animate progress with filling the color of the border width of a UIImageView layer

寵の児 提交于 2019-12-06 10:09:03
问题 I have am UIImageView and I have made it to be circle with a width layer like in this image : User can update the image and upload new one, I have a progress call back while image is uploaded. What I want is to animate the border with color while the image is uploaded, for example when user click upload the border start from top with green color and fill the width according to the progress. I tried with this code: CAShapeLayer *circle = [CAShapeLayer layer]; circle.path = [UIBezierPath

Resize UILabel correct on top of UIImageView

廉价感情. 提交于 2019-12-06 10:01:31
问题 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. 回答1: You can resize a UILabel proportionally using:

+[NSURL URLWithString:] returning nil

北城余情 提交于 2019-12-06 09:46:55
I use this code to load a UIImage from a URL : NSURL *imageURL = [NSURL URLWithString:@"http://testwebsite.com/image.png"]; NSData *imageData = [[NSData alloc] initWithContentsOfURL:imageURL]; imageView.image = [UIImage imageWithData: imageData]; but I'm stuck at a URL that looks like this one : http://www.testwebsite.com/getFile?userID=123 this works fine in the browser but returns nil in the imageData variable above. how can I load the image from such an obscured URL (i.e. from a URL that does not show off the file name but rather redirects to the image file) ? thank you in advance. for some

“Pinch to Zoom” using AutoLayout

爱⌒轻易说出口 提交于 2019-12-06 08:58:36
问题 I have followed many "Pinch to Zoom" tutorials I found online, and have done reading on AutoLayout, but I can't get it to work in my project. My whole project uses AutoLayout, so I don't want to turn it off. I am loading a huge UIImage (EG: 5000px on long edge) into a UIImageView, and i'd like to be able to pinch to zoom and move around the zoomed in image. I've tried using UIImageView inside a UISrollView, but I couldn't get it to work properly. The closest I could get was some random