This question already has an answer here:
embed live camera view inside a UIView
(1 answer)
Closed 7 years ago.
Just to clarify, I am very new to coding. This project that I am doing right now as one attribute that is way beyond anything I've learned as of yet, but I really would like to figure this out so I can build the rest of my simple app.
In my app I would like to have a live camera feed from the back camera of the iPhone. I don't want this view to take up the entire screen, I want to have it just as a small portion. I don't even want this camera to take pictures I would rather it just have the live feed and that's it. I am using swift and Xcode 7.
Any chance someone can point me to a tutorial or give some advice?
Thanks.
Use AV Foundation. You want an AVCaptureSession (to run the camera) and an AVCaptureVideoPreviewLayer (to display what the camera sees).
Related
I want to play video streaming using MobileVLCKit in fullscreen mode.
How can I do this?
Please share code if possible (swift)..
I just saw that my previous answer on the old thread was massively downvoted back then. It's still true though. MVK renders in a simple UIView, so it is the obligation of the client app to implement the view handling, be it a tiny one or one filling the screen.
Note that there is sample code available on how to integrate MVK here: https://code.videolan.org/videolan/VLCKit/
In my app, i want users to click a photo, then i want to allow them to edit it for crop/rotate/straighten. Can i use built-in photos app for that? or is there any open-source/api to have similar view controller.
I know it's a possible duplicate of Is there a view controller for image crop and rotate works like iOS 8 photo.app? but i found no answer here as well.Please let me know if it's possible?
Unfortunately, no.
UIImagePickerViewController allowEditing property, when set to YES, provides you a very simple cropping UI, but it doesn't support advanced rotation as iOS Photo app.
So you'll have to make it yourself.
The github projects in the question you linked might be a good starting point for that. (here's another one)
Good luck !
I wrote one in Swift, you can continue to develop based on this: QCropper
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
I want to create a QR-Reader App that is a two page Application. Both are accessible with a tab bar. The first page should be the QR reader part. The second should store the read QR codes in images.
I have a QR-Reader already coded, but i don´t know how to test the iPhone app on my Mac. Is that even possible?
And my second question:
How can i save the result of my scanned codes in the other page?
iOS 7 now has the ability to detect QR codes and other barcodes directly. There is a sample app built right into the Xcode help system that shows how to use it. I'm on a different machine right now so I can't seem to find the app. I'll take a look on my other Mac and post an edit if I can find the sample code.
EDIT: I was mistaken. The sample App is not from Apple, its an open source GitHub project.
The link is:
Sample project to recognize QR codes
Be sure to look at the other postings from this company. They all look very good.
(A link to other projects in the iOS 7 series:
iOS 7 Day By Day
You might want to use that rather than custom QR reader code.)
As to how to test QR code scanning from your Mac, that's going to be a problem. QR scanning involves using the built-in camera, and the simulator does not let you use a Mac camera as an iOS camera. I think you will probably have to do your testing on an actual iOS device.
As to how to "...save the result of my scanned codes in the other page" that depends. Do you want to save a picture of the QR code, or the text information that comes from decoding it?
If you want to save a picture then you would need to code your QR scanner to capture the image as a UIImage, and then pass that to your second view controller. You could do that in the prepareForSegue method that links to your second view controller, assuming you're using storyboards.
The same basic technique would apply if you want to pass the text info from the QR code.
You need to provide a better description of how your app is structured and what you want to do if you want specific help with that, but that sounds like a more generic "how do I pass info from one view controller to another" type question, of which there are hundreds here on SO.
You could make your QR code reader detect if it's the simulator. If it is, it could just give you an image picker, or even just choose a hardcoded test image, and have the QR reader examine that image. However you can't fully test the functionality in the simulator, so you would basically have to test on a real device to make sure it truly works correctly. You would never want to release an app that's only been tested in the simulator anyway.
As for saving the result of the scanned codes, you just need to implement a data model (could be NSMutableArray, for example) that you have access to from both view controllers. When you switch to the second tab, it could check this array each time it is about to appear to update its state. You could probably add this array to both views in your app delegate in the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method. Just get your root view controller from the window, which should be your tab bar controller, and get the view controllers from the tab bar.
i'm looking for an AR API (possibly free) or SDK that may be used on IPAD.
I've tried Wikitude so far, but it's not adapted for IPAD for the moment, and most of the well known API seems to be only made for iPhone..
Any clue on this one?
Any chance that this API offer the possibility to add the AR view as a subview (for example as an element of a tab bar..:))
Thanks a lot
Why are you going for 3rd party library? You can apply AR using local library. On your ViewController make 2 UIView. The one in the back implement Camera View on it. And the one on the front implement whatever you want to show on the live preview of camera. Then if you want to capture the screen just simply take a screenshot and it'll be saved.
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
How can I prevent users from taking screenshots of my application window?
So far I have be able to stop the Prt Sc key press and able to clear the clipboard so that my application cannot be screen grab.
However as a test I tried used Corel PaintShop pro and an option it has is to import screen capture which is very different from screen grabbing using the clipboard and as I suspected my application did not stop this.
So I have found the following code at this site : http://www.bitwisemag.com/copy/delphi/delphi1.html
This uses a different way of grabbing what is on screen and I presume that Corels method is similar to this. Is there anyway of this method of screen grabbing from being used on my application.
Greg Hewgill - Cheers for this - I will read this post
to get a screenshot on Windows is trivial, eg GetWindowDC(NULL). The only way I can think of is similar to this answer: stackoverflow.com/questions/455623/… – Nick
Nick looks like the same post that Greg has mentioned - however cheers for your response
Why go to this trouble? People nowadays can simply take a photo with their phone and send that around? – Marjan Venema
That may be true Marjan but I am trying to stop spyware programs from click logging if that makes the matter clearer.
The only way I can think of is to use DirectX. When certain apps such as DVD players write to the screen using DirectX, Windows sees a black (not quite black, but close) rectangle where the video shows. Attemps to use PrintScr or GetWindowDC() return that black rectangle. High-end screen capture apps like Snag-It can use DirectX to render the image properly, but this would be a 99% solution for you, and as others have said, users can always take a photo anyway.