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

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.

Related

UIScrollView application (w/ paging enabled) to load images only relevant to current page

I am wondering if anyone can offer any advice towards solving this problem.
I am building an app that uses a UIScrollView with paging enabled, with each page corresponding to downloaded and parsed XML data. Part of that XML data is a URL to an image.
Now, it would take forever to load an app that downloads the image for every XML entry and then push it to the respective UIScrollView page created on runtime with the rest of the XML data.
Is there a way to be able to detect which UIScrollView page you are on and then download the image as needed and still allow the rest of the data to download at runtime?
Try to read SDWebImage or Apple's LazyTableImages
Just as referenece, I solved it by adding all of the image views into an NSArray. Using the scroll view delegate, I was able to determine which page number I was on, and translated that page number to an integer that I used to access the appropriate uiimage view located within the array.
It seems to work great!
Might you offer a better solution?

Using One UIImageView that Changes Based on Button Pushed

This is a very basic question, but I cannot figure this out. I'm new to iOS/XCode. I've gone through a few tutorials that somewhat covered this (but a little more complex). I have an Android app that I'm trying to port over to iOS. I'm using storyboards for this app.
The basic premise is that the app contains 27 thumbnail/full images. For this question, we'll say the 27 pictures are split into 4 categories: cats, dogs, sharks, whales. Currently, I have the app launching with Navigation Controller w/ View that shows 4 Buttons with these categories. These push out to 4 separate view controllers each set up with buttons with the thumbnail as the image. I want to select the thumbnail and show a scene with the full image. I only want one full image view controller with a UIImageView in it that will display the full image of the thumbnail pressed. (Using table views may be easier, but I want to control the user interface and have more than just a rows of items to select.) Also, I'm not sure if this matters in the eventual set up, but from the full image scene I will want to add a play button that will play a local mp4 file (but that's for another day).
The image set will remain static so I was trying to incorporate NSArray with the full image name stored. I believe I have to add a file that is subclass of ViewController and incorporate code that will take on the full image file name based on the button pushed. This is where I'm stuck. In java for Android, I just had listeners on each button and used a case statement to set the full image variable and passed it to my full image class/xml.
Another option I think I remember seeing somewhere is I could use the title of each button and enter the full image name there. Then when the button is pressed, the title is passed to the full image view. I think this eliminates the need for an array (???).
Any help is appreciated.
Thanks,
Jason

Best way to display web content on my iPhone app (if possible without using UIWebView)

I want to build an iPhone app that should , among other things, display the some content of a website's detail pages. This content includes a)a title b) an image c) a text passage (with multiple paragraphs.
I have done a brief research and found out that the easiest way to do this is by using uiwebview. The problem is that in that scenario I would have to be constantly in touch with the person responsible for the website in order to create a modified html/css version for the iPhone client.
As a result I was wondering if there is a feasible alternative. I can get the data I want in json format with HTML Requests. Maybe if I used a UIScrollView that contains a UILabel for the title, a UIImage for the image and another UILabel for the text passage? But the problem is how to set the UIscrollview content size since it dependent on the size of the text passage?
I am a iPhone dev noob and I am possibly missing something obvious here so I would be very greatful if someone could point me in the right direction.
Sounds like you are building an app ontop of somebody elses content. Provided this is legal, this other site should have a published api where you can start to write your app. Get the json or xml, then populate them in a UIViewController using a UIImageView to display the image, UITextView for the text. The UITextView already has a built in scroller so you dont need a UIScrollView

Dynamic graphics rendering on the 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.

How do I prompt a user to select an image on the iPhone?

I would like to allow the user to select one of several pre-supplied images. Is there a standard way to do this?
The only thing similar to this that is Standard would be the Image Picker control.
However for this to work you would have to add your images to the iPhone's image library and the user would have to pick them from out of all their other pictures.
What you need to do is build something similar.
You can go as easy or complex as you need/want.
I would go simple (as that is the idea of the iPhone) and have a scroll view (depending on the number of pictures you want) and load thumbnails of the images. When they select one, you do something with it. (Look at the view when you are looking in a photo album on the iphone)
I believe I have seen open-source representations of this before.
I would check google code.
I use a UITableView for this, with a thumbnail and description of the image they're choosing.