Multi changeable areas of a image on a iPhone - iphone

I have an image with picture of a person and I want to let the user to pick some area of the person and change the color. But how can I best create a multi-mask image?
E.g. should the user be able the change the color for a leg or a hand.
I am using Titanium Appcelerator, and right now I had a solution with buttons placed over the image, which is not a pretty and accepted solution.
The Kitchensink example, has only one area which can be changed.

The only solution I found for working with sections of an image is to divide the image into different views then use a vertical or horizontal view to glue them together. Sounds like you took a similar approach using buttons.
Another option might be to use one of the jQuery image libraries within the webview. This most likely will have a performance penalty though.

Related

ios measure tape custom control

I want to build measuring tape custom control. It should be like one used in Weightbot application.
Measuring tape is shown only partial on the screen, an by dragging you can pick from 0cm up to 1km.
One way i though of how to do it is to place a very long image in sliding UIImageView, but i sense there is a better way.
Any ideas how to implement this other than static image?
The weightbot application you link to looks like it uses a custom view.
You could use a combination of an image (for the gradation) and custom drawing for the numbers. You don't have to use a single long image that scrolls.
This sounds like a perfect use of a UICollectionView, if you can target iOS 6 or newer. It does the cell reuse you mention in your comment, but it supports sideways scrolling, which table views don’t. You can do custom drawing for each cell, which might mean you don’t need images at all, or else you can combine a simple repeating image with some dynamic text.

iPhone hide portion of image in UIScrollView

I am brand new to iPhone app development. I am trying to create an image reader using UIScrollView. I need to focus a portion of an image and hide the rest. Till now I am only able to focus required part of an image but have no clue how to hide the rest. I had a suggestion that, I need to add four views at top, bottom, left and right. I need to hide those as per requirement. But, I was able to go no where with the suggestion. Can you please tell me how can I implement the functionality?
I don't understand what you really want to do. But if you think putting for views above I might suggest you use mask image for the same. Use alpha component.
Atlast I was successful in hiding part of an image. I used four views with background color and resized them according to the portion I need to display.

How to draw an image according to the pixels of another image?

HI all ,what i want is to map the images.Suppose i have two images of persons,one is of fat person and another is of weak person,Now i want to match their faces ,eyes.I want to increase or decrease the face size eye size of one image according to another.As you can see in adobe photoshop you can make the face fat,make it squueze.I want to do the image manuplation in this.These types of operations i want to implement.I don't know from where to start.
Pleas guide and help me.Can i perform all this with core graphics if so then how
Any reference,tutorial address ,sample code ........appreciated.
You are probably going to have to deal with some sort of edge detection and face recognition algorithms, at the very least, if this is to be accomplished automatically. Otherwise, if the user is going to be resizing one image to match the other, this will require simple resizing operations driven by perhaps user pinch & gestures.
UPDATE:
For manual resizing:
Download the source code for the great book Cool iPhone Projects. One of the projects is called 'Touching'. This project contains code that accomplishes what you need: pinch and zoom functionality.

UI Button with Image Smaller than Touchable Area

I've not much response so am adding some more info.
My buttons are not rectangular, nor organised in a grid so I need a way of creating what looks like a button (and shows that it has been pressed visually, as per a standard UIButton) but where the touchable area is different to the image area.
I am using a transparent PNG and that element works fine. I've added the buttons in Interface Builder and am wondering if that is the problem.
However, if I change imageEdgeInsets, it distorts the image display, which is obviously not what I want.
Bizarrely, if I increase the dimemsions of the button, it doesn't change the image, but if I decrease them it does.
I have tried different combinations of mode (scale to fill etc), but to no avail.
I am aware that there is an image and background image property, but in IB there is only one.
Essentially, I don't understand how the geometry works and the Apple documentation doesn't seem to help.
Surely, I can't be the only person to try to do this. Any help would be warmly welcomed.
Many thanks,
Chris.
Try setting the buttons setting to Aspect Fit. This will fill the button with your image so a smaller image than the button size would leave the space around the image.
Also set the button type to custom.
In the end, I stumbled across Ole Begemann's Non-rectangular buttons class. It just does what I need - to be able to create buttons where the touchable area follows the visible element of a non rectangular image.
#Helium3 - thanks - that allowed me to use a larger touch area, bit not a smaller one.

"Slider" type label as seen on Facebook and AP Mobile News

Please pardon my lack of Photoshop skills, but I'm curious what type of strategy Apps like Facebook and AP Mobile News are using for the 'label slider' in their applications. Here's a quick snippet outlining what I'm talking about as I'm sure the name I'm labeling the utility as is being butchered: http://dl-client.getdropbox.com/u/57676/slider.jpg
Essentially the user can touch the label and glide it along the X axis. It has a smooth bounce effect also once it hits the edges. This gives quite a bit more real estate if you need to present more on the screen than what your portrait mode allows for and is thus very valuable.
Is it a matter of just creating a UILabel that's wider than the screen with a bit of Touch API + Core Animation? Would love insight on how to start tackling this thing.
You'll most likely want to use a UIScrollView, with a UILabel as its content view. Size the label appropriately to your content, and then set the contentSize property of the scrollview to that size.
I created a similar control, and it's much easier than you think. It's just a UIScrollView with a series of UIButtons added to it. You could use labels instead of buttons - just depends on the feel you want. I think Facebook is probably using labels for theirs.
In any case, you'll probably want to use a series of components rather than one component (which is what Ben suggested) in the event that you want to, say, style the "selected" label differently from the others. It also makes hit detection a little easier.
You get the bounce effect for free by default - you may have noticed that most scroll views in iPhone apps do the same thing. It can be turned off as well.