Dynamic graphics rendering on the iPhone? - iphone

What I want to achieve is some way of supplying dynamically generated visual content that the user of a device could interact with - touch icons, text links, images etc embedded within some graphic image generated either on the phone or on a server. I would need, pinch, zoom, rotate functionality aswell.
Is it possible to render graphics dynamically within the iPhone's UI? So, for example, would it be feasible to supply an XML file to a device and have that render a custom map within the device? Would you have all the pinch-zoom, rotate and click on icons type functionality of a normal UI?
Alternatively, could I pre-render a png on a server and supply that to the device?
Any ideas or suggestions are appreciated.

Look into Quartz2D to help you do the custom drawing, it should do pretty much anything you want to do....

Sure, any of those are possible.
You'll probably need to write some code to interpret your XML file and generate an appropriate UIView and then embed that in the window.
And you're totally welcome to download images and display them in a UIImageView.

Related

Image with gestures - phonegap

I'm making an application who needs to display a map, contained in a large image file (png). The user must be able to zoom in/out the image and drag it in order to scroll the image with touch gestures.
I'm not sure that you get it, but i want to display a single image as it would be displayed by the "Photos" iphone application.
I would like some hints about the best way to do it with those gesture and with a navigation header in order to leave the image view.
Thanks in advance if you can give me any help about this issue because I did not find any clue on the phonegap doc.
/ouss
Why don't you use the built inn components for this?
Sounds like you need to wrap an ImageView inside a ScrollView and a HorizontalScrollView, then rescale the image by handling onTouch-events.
Take a look at the MapKitPlug plugin:
https://github.com/phonegap/phonegap-plugins/tree/master/iPhone/MapKitPlug
Good Luck!
I would use http://cubiq.org/iscroll-4 which has some really slick image zoom going on. You can also start loading new images after certain zoom levels for finer grains of quality.
I would suggest Child Browser phonegap plugIn.
It is very simple and easy to implement.
It supports loading page from a url as well as you can show any kind of images.(png, jpg, jpeg, bmp and gif)

What is the best way to view large PDFs on iOS?

I am currently using QLPreviewController to view PDFs (250MB+) However it cannot deal with real large files. Either I get the info that not the whole file has been loaded or the whole app just dies.
I also need to customize the view which is nit possible using QLPreviewController.
What should I do? Use UIWebView instead? Or will I have to use CGContextDrawPDFPage?
Using the latter, how will I get zooming implemented?
I would go with your suggestion of using a UIWebView. Doing so will automatically give you zoom support and the UIWebView should handle loading extremely large PDF's.
If you have decided to go with Quartz, this link looks very promising for zoom support.

iPhone/iPad draw pdf like iBooks?

Does anyone know how to use core graphics to draw a pdf like in iBooks. I can already draw a pdf page using core graphics but was curious how iBooks shows a lower quality view of each page so it loads fast and then when you stay on a page longer it renders it a full quality. This makes it able to open the pdf without having to make the user wait like most magazine apps you see on ipad. Any ideas would help!
Apple have some "ZoomingPDFViewer" sample code:
http://developer.apple.com/library/ios/#samplecode/ZoomingPDFViewer/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010281
I suspect that might give you some good ideas :-)
I assume they use multiple layers, the first layer loads the pdf in low resolution and the better resolution is prepared in the background. When ready these layers are swapped.
Have a look at CGPDFDocumentRef and CATiledLayer in the documentation.

How do I specifically get a static Web image url and apply it to an iPhone application blank view?

In building an iphone app, I can render a blank view, (say that's all I have, just a generic, full screen view) and I want to populate in that view an image from the web, say, "http://www.mypicture.com/mypicture.jpeg". I want to do this as fast as the network allows and not use the photo roll or any part of the os that the user can see. How would I implement this? Also, how do I capture an snapshot (fullscreen or not) image from Google street view without the user knowing so? Thanks all for your anticipated time...xobmo
Use this example, replacing the html with an <img> tag with your image as the src attribute.
Alternately, you can base64-encode your image as in this example, but I figure you'll probably do what's easiest.

iPhone SDK Zoom and refresh PDF with Quartz

Looking at the QuartzDemo sample application, I love the speed of the PDF rending using quartz alone (that is, without using uiwebview). However, when I'm zooming in the PDF it doesn't seem to become more clear like it does in PDF view.
Is there something that I can change to have the same effect when zooming in and out using multitouch? like manipulate the PDF transformation matrix or something?
Thanks a bunch.
--Ben
To make it zoom, and more clear,
You can use CATiledLayer. You can see the following example.
http://www.olivetoast.com/blog/hamish/simple_uiscrollview_catiledlayer_example.ot