就拿上使用蓝牙其他iOS设备的照片 [英] Take pictures on other iOS devices using bluetooth

查看:192
本文介绍了就拿上使用蓝牙其他iOS设备的照片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我倒是AP preciate如果有人与iOS蓝牙经验可以告诉我怎么承担使用蓝牙类的其他iOS设备的图像。这个程序可以让用户登录/注册事后采取和上传照片。 <一href=\"http://www.raywenderlich.com/13511/how-to-create-an-app-like-instagram-with-a-web-service-backend-part-12\" rel=\"nofollow\">http://www.raywenderlich.com/13511/how-to-create-an-app-like-instagram-with-a-web-service-backend-part-12我的目标是,就在应用程序的UIScrollView用户的照片(其中显示所有上传的照片)自来水,激活下面AVFoundation的 snapStillImage 方法。

I'd appreciate if someone with iOS bluetooth experience could show me how to take pictures on other iOS devices using bluetooth classes. This app lets users login/register and afterwards take and upload pics. http://www.raywenderlich.com/13511/how-to-create-an-app-like-instagram-with-a-web-service-backend-part-12 My goal is to, on tap of a user photo in the apps uiscrollview (which displays all uploaded photos), activate the snapStillImage method of AVFoundation below.

//this code takes a picture
- (void)snapStillImage //this takes a picture via [self snapStillImage] in viewDidLoad
{
dispatch_async([self sessionQueue], ^{
    // Update the orientation on the still image output video connection before capturing.
    [[[self stillImageOutput] connectionWithMediaType:AVMediaTypeVideo] setVideoOrientation:[[(AVCaptureVideoPreviewLayer *)[[self previewView] layer] connection] videoOrientation]];
    // Flash set to Auto for Still Capture
    [ViewController5 setFlashMode:AVCaptureFlashModeAuto forDevice:[[self videoDeviceInput] device]];
    // Capture a still image.
    [[self stillImageOutput] captureStillImageAsynchronouslyFromConnection:[[self stillImageOutput] connectionWithMediaType:AVMediaTypeVideo] completionHandler:^(CMSampleBufferRef imageDataSampleBuffer, NSError *error) {
        if (imageDataSampleBuffer)
        {
            NSData *imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageDataSampleBuffer];

            photo.image = [[UIImage alloc] initWithData:imageData];
            [[[ALAssetsLibrary alloc] init] writeImageToSavedPhotosAlbum:[photo.image CGImage] orientation:(ALAssetOrientation)[photo.image imageOrientation] completionBlock:nil];
            [self uploadPhoto];
}
    }];
});
}

标识想象每个用户都需要成为在登录的中央/周边?我有设立BLE在iOS更不用说配备了服务器功能0经验。任何想法或提示将是真棒。

Id imagine every user would need to become a central/peripheral at login? I have 0 experience with setting up BLE on iOS let alone equipped with server functions. Any ideas or tips would be awesome.

推荐答案

您应该看一看在iOS7 + <一个href=\"https://developer.apple.com/library/$p$prelease/ios/documentation/MultipeerConnectivity/Reference/MultipeerConnectivityFramework/index.html\"相对=nofollow> MultipeerConnectivity框架,允许附近的设备以彼此之间的沟通。这是很容易通过这个框架,裹成的NSData 变量从一个设备发送消息到(一)其他设备(S)。

You should have a look at the iOS7+ MultipeerConnectivity Framework, which allows nearby devices to communicate amongst themselves. This is easy to send message from one device to (an)other device(s) through this framework, wrapped into a NSData variable.

此框架是很容易成立,但不要犹豫,看看的 GitHub上的搜索结果

This framework is really easy to set up, but do not hesitate to have a look at GitHub search results.

这篇关于就拿上使用蓝牙其他iOS设备的照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆