iOS programmatically capture image - ios

This is more of a theoretical question. I'm fairly new to iOS programming so haven't nailed fully the terms to use in scenarios like this. I've been asked to create an application where I need to fire an event to capture an image programmatically. The application will be in the foreground, and will have the requisite permissions to use the camera. I've been unlucky with my searches so far - likely because I haven't termed them correctly.
My question is this; Given an application with a camera view, set up to capture images - is it possible for me to fire an event within said app to capture the image, without a button necessarily being pressed? If so, how would I go about finding documentation to guide me through?
In an ideal world, I'm hoping for something as simple as cameraObject.capture() or something of that ilk - but an ideal world is a rarity!
Thanks in advance!

Related

ARSCNView as VRView

Long things short:
I want make my iOS application Mac friendly. In my case I want (I don‘t know how to do) to use my ARSCNViews as an view that presents me everything in VR.
I don‘t want to have any special room. I only want to show SCNNodes.
Short:
I have got an ARSCNView so I see things in AR,
*but I want to see the things(SCNNodes) in VR, so that the users don’t have to continue using camera.
I want to see make an VRView from my AR(SCN)View.
I couldn‘t find any information how to do that.
I tried hard for 4 days.
Does somebody know how to do that?
Thanks
PS:
I already tried:
create a new camera
Use some not helpful code from Stackoverflow and  Dev Documentation
Like Stereo
Tried to create to ARSCNViews to give one as the input for the other on (I gave the first non camera input
(Something really stupid) I wanted to use an SCN
The simplest solution for nonAR (a.k.a. VR) app is to use SCNView.

How to automatically adjust a photo (ie. brighten, contrast) on iOS?

My iOS app (objective-C) handles photos. I'd like it to be able offer the user a way to automatically "adjust" an image, like how iOS itself does in the Photos app (little magic-wand icon), or how facebook does it. This basically means auto-brightness and auto-contrast adjustment.
So far i've found "filtrr" (more concerned with adding color it seems), and OpenCV (uhh, feels like using a nuclear missile to swat a fly with). Any other hints? Is there some library or a way of even doing this natively in iOS?
thx!
Look into Core Image for info on filters and how to apply them. Apple's programming guide is a good place to start.
Once you're up and running with Core Image, see the autoAdjustmentFilters method for getting a set of filters that's preconfigured for "one touch enhance" kinds of usage.

How to make a slider volume controller on iOS? Objective-C, iOS 7 (or 8), xcode 5 (or 6)

I am learning to develop iphone apps and I have a simple question.
I am making a really simple app which allows the user to set the volume of the device on the settings screen using a slider instead of the volume buttons.
It may be quite obvious for experienced developers but I just can't find the answer I am looking for.
My question is:
How can I make this slider?
Basically I want to do this (image: https://www.dropbox.com/s/b81bzdwyrab0ha7/slider.png?dl=0):
I used to think that I could use a regular UISlider but some documentation says that I need to use something called a MPVolumeView. The problem is that I can´t find a good tutorial that tells how to use this explicity.
I found this link on the apple documentation but I dont understand how this works. – http://developer.apple.com/iphone/library/documentation/MediaPlayer/Reference/MPVolumeView_Class/Reference/Reference.html
And the description says: Use a volume view to present the user with a slider control for setting the system audio output volume, and a button for choosing the audio output route. When first displayed, the slider’s position reflects the current system audio output volume. As the user drags the slider, the changes update the volume. If the user presses the device volume buttons while sound is playing, the slider moves to reflect the new volume.
This is exactly what I want but I dont understand the example it gives. If you could please tell me how t make this slider work, even if it is on a new one-view project, I would really appreciate it.
Also I am aware that this method also creates an airPlay button next to the volume slider. Is there a way to delete this button? (My app is a simple productivity app so I only want the slider, not the airplay button).
I also understand that this will not work on the simulator. How am I supposed to know that this will work without having to test it on an actual device (I am not registered as a developer yet)?
Plus, I only know objective-c, not swift. If you could please restrain from using swift in your answers I would apreaciate.
Thank you so much for your help.
PD: English is not my first language. Sorry for any mistakes I made.
The MPVolumeView class is designed to let you do exactly this. It's in MediaPlayer.framework, so add that to your app to make things build correctly.
You create it and make it visible the way you instantiate any other subclass of UIView, which you probably know by now.
You disable the routing button by setting the "showsRoutingButton" property to false.
"How am I supposed to know that this will work without having to test it on an actual device?"
By seeing that it's been there since iOS 2.0, and is used in countless apps?
The process to writing such a slider is incredibly simple, look into UISlider(https://developer.apple.com/library/ios/documentation/UIKit/Reference/UISlider_Class/) and then use the float value from the slider to set the volume.
If you do not want to write your own slider, look on GitHub(github.com) for controls that do this for you. After doing a quick search, I found this UISlidersubclass that adjusts volume.

blackberry camera Application

I am implementing camera application using then example comes with blackberry plugin for eclipse named "CameraDemo" the problem is that when the screen loses focus It does not display the camera view istead of it shows like this
has anybody faced such problem whats the solution?
This way of taking picture (using the Player and VideoControl.getSnapshot()) does not work nice on all BB models. I'd even say it works nice only on a narrow set of BB models. So if you are going to use your app on a wide range of BB models, then this is not the right way to go.
Instead to take a picture use a built-in Camera app. Here is a starting point on how to do that.
Basically you invoke the built-in Camera app and listen for the file-system changes to detect a new image file path. Then you need to close the built-in Camera app somehow - it's possible to do that by simulating two 'Esc' button presses.
Yes, this sounds a bit hacky/over-complicated, but that's how BB engeneers arranged that for us. :) BTW, this is actually not so bad if compare with Android where different device manufactorers violate the common rules and implement the Camera app in their specific way so you are not able to write the code once covering all Androids.

Preventing screen grab within Delphi [duplicate]

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.

Resources