iPhone - Printing multiple images on one sheet - iphone

I have an array of jpgs (7) that I would like to print. All the images are the same size, 900x1382, and I would like to print them two to a page by rotating them 90 degrees and printing them top/bottom on a letter sized piece of paper.
It sounds like I need to create a printFormatter but that's where I am getting stuck. I have read through Apple's Drawing and Printing Guide probably 10 times and I cannot figure how to do what I want to do.
Can someone help me out or at least point me in the direction of a good tutorial?

- (void)drawPageAtIndex:(NSInteger)pageIndex inRect:(CGRect)printableRect
{
// You can draw images in the specified rect.
}
Try to subclass UIPageRenderer, then override the above function. You can draw the images in specified rect. I think you have to check the Apple's PrintPhoto sample code, and custom drawing from your old guide. Check it and add comments about this. thanks :)

Related

How to draw number into circle shape?

I am trying to draw the numbers into circle shape.
But I did not succeed. I have tried some tutorials which are available but could not succeed.
We haven't fixed the numbers to show in circle. Numbers are dynamic.
I am attaching snapshot below so that I could clear what I am really trying to do.
Help would be appreciated.
You could use David's suggestion of placing labels by translating and rotating them. That would be easiest, but would involve a fair amount of overhead.
Alternatively you could use CoreText to draw your text along a CGPath that's a circle. Erica Sadun's excellent "iOS Developer Cookbook" series includes a recipe that shows how to wrap text along a curved path using Core Text. I don't remember which volume it's in however.
A third option would be to use Nick Lockwood's excellent iCarousel framework to create a circular carousel out of the numbers you're using. It is very flexible and you should be able to adjust the settings to get a look very similar to the control you've posted.

Draw area from given points on iphone

I want to draw an area from given points on a map using the Google API on iPhone (I always have more than 2 points). If it is possible I want this area to be with alfa 0.5 (so people will be able to see routes underneath this area).
I would appreciate any code and links.
There are a few similar questions, but I didn't find anything just like this, so please correct me if I'm wrong.
Just use a MKOverlayView and give it a proper frame (of type CGRect) calculated from the given points. Set the alpha of the view to 0.5. Note that frame and alpha are properties of UIView, of which MKOverlayView is a subclass.
Read everything about this class here.

Why does my text look so bad in my ios App?

I have a uiscrollview that has a custom child view that contains text and images.
The text items are UILabels. I have attached an image representing the quality issue:
Do you guys think it might be worth a shot to draw the text, then convert to a uiimage and display that instead? Maybe it would scale better? Or perhaps there is a way to smooth the text?
There's no reason to expect that you're going to draw the text better than UILabel does. Your picture is very hard to make out, but here's what you want to look at:
Are you just adding a UILabel to the UIScrollView's contentView, or are you doing something else fancier. That "something else fancier" could easily be the problem.
Make sure you're drawing on pixel-aligned boundaries. The easiest way is to make sure the origin of your UILabel is integral (not a fraction). On a retina display, you can get away with half-points, but it's usually easier just to make everything integers.
I thinks it is the position issue. I bet you set the x or y value to float value like 12.3 or 12.5 .
What I have done now is I have created a uiimage version of my text and am showing that now instead of the uilabels, the quality is soo much better, you can really see the difference when you are looking at it scaled up on the ipad, it must just do a better job scaling images then text?
Before:
After:
The above images show how the text renders on the ipad with my app scaled up, before and after my change.

Combine 2 UIImages as one, one of them is rotated

I'm getting at one point with iOS. I have 2 UIImage which are bgImg & img. BgImg is actually the background image, img is a smaller one which places in the bgImg' bounds.
I need to combine 2 of these images as one, called finalImg. The problem is img should be rotated in a select angle. I have done so many tests with no result. If you have any ideas, please help me. What I need is just to return the combined image.
Thanks so much, my fellow iOS developers.
Thang
You need to create a graphics context, draw your two images to it, and then capture a new image from the context, as described in this post:
Saving 2 UIImages to one while saving rotation, resize info and its quality
If you don't already have the rotation of your foreground image worked out, then the first answer to that post should help you as well.

how to animate some portion of images?

I am implementing fun application.In which i want to animate some area(portion) of images.
I dont know how it possible.If u have any idea then please help me.
If you're looking to animate a portion of an image you could just create a smaller animation and put it at the right relative location inside a larger image.
If you want to know how to animate images in general, that's a different question entirely.