小编iAh*_*med的帖子

从Front Camera iOS 5.0捕获时始终看到镜像

在从前置摄像头捕获数据时,我总是获得镜像,如何在预览窗口中看到我所看到的内容.我已经准备好videoMirroredTRUE.以下是代码段:

AVCaptureConnection *lConnection = nil;

  for ( AVCaptureConnection *connection in [lHandle->m_output connections]) {
     for ( AVCaptureInputPort *port in [connection inputPorts] ) {
         if ( [[port mediaType] isEqual:AVMediaTypeVideo] ) {
             lConnection = connection;
             break;
         }
     }
 }
if ([lConnection isVideoOrientationSupported])
    [lConnection setVideoOrientation:AVCaptureVideoOrientationPortrait];
if ([lConnection isVideoMirroringSupported])
    [lConnection setVideoMirrored:TRUE];
Run Code Online (Sandbox Code Playgroud)

更改setVideoMirroredTrue/False也不会更改任何内容(isVideoMirroringSupported返回成功)

iphone ipad ios ios5

9
推荐指数
1
解决办法
1万
查看次数

Google云端硬盘(文档)导入错误:图片未在更新的文档文件中显示

嗨Google Drive API支持人员,

在过去的几天里,我们遇到了Google云端硬盘的严重问题.

我们无法再使用图片更新文档文档.当我们的iPhone应用程序发送使用图像更新Docs文档的请求时,服务器返回OK,但内部图像将永远不会上传.

再现问题的代码在这里.

- (void)selfOverwriteSelectedFile:(GTLDriveFile *)gtlDriveFile
{
    // -- not working type -- can't upload images on ODT, HTML, RTF, PDF
    NSString *mimetype = @"application/vnd.oasis.opendocument.text"; //@"text/html" @"application/rtf" @"application/pdf"

    //works: DOCX
    //NSString *mimetype = @"application/vnd.openxmlformats-officedocument.wordprocessingml.document";

    NSString *downloadUrl = [gtlDriveFile.exportLinks additionalPropertyForName:mimetype];

    //1st request: download the file
    GTMHTTPFetcher *fetcher = [self.driveService.fetcherService fetcherWithURLString:downloadUrl];

    [fetcher beginFetchWithCompletionHandler:^(NSData *data, NSError *error) {
        //2nd request: re-upload the same file
        gtlDriveFile.mimeType = mimetype;
        GTLUploadParameters *uploadParameters = [GTLUploadParameters uploadParametersWithData:data MIMEType:mimetype];
        GTLQueryDrive *query = [GTLQueryDrive queryForFilesUpdateWithObject:gtlDriveFile fileId:gtlDriveFile.identifier uploadParameters:uploadParameters]; …
Run Code Online (Sandbox Code Playgroud)

objective-c google-drive-api

6
推荐指数
1
解决办法
1139
查看次数

如何在iPhone应用程序中显示不同的自定义阿拉伯字体?

在我的应用程序中,我需要显示具有不同自定义字体的阿拉伯文本.我按照添加ttf文件的方案info.plist.

根据上述情况,我成功获得了不同字体样式的显示文本仅适用于ENGLISH文本.我为阿拉伯语字体样式做同样的事情,但在这里我没有得到.为什么会这样?

请任何人都可以帮助我

提前致谢.

iphone arabic uifont custom-font ios

4
推荐指数
1
解决办法
4135
查看次数

问题添加两个双号

我有一个非常愚蠢的问题我只是简单地输入on double并将其添加到已经声明的其他double并分配一个值但sum并未显示浮点数

double d = 4.0;
// Getting second double from user
double numDouble = Double.Parse(Console.ReadLine());

//Printing double number :
Console.WriteLine(d + numDouble);
Run Code Online (Sandbox Code Playgroud)

结果总是4.0 + 2.0 = 6但我想6.0 任何想法

c# console

4
推荐指数
1
解决办法
5690
查看次数

在cocos2d中捏时如何缩放精灵?

我正在开发一个应用程序,我必须显示50到70个图像(精灵).我已经制作了一个滚动滚动所有这些图像,但我也想缩放这些图像我也一直在关注" http:// ganbarugames .com/2010/12/detected-touch-events-in-cocos2d-iphone / "这个教程.我想要完全相同的东西,但是那个教程只为一个精灵做了缩放的东西,但我想在每个精灵上做什么我该怎么办?请帮帮我?

-(void)ccTouchMoved:(UITouch *)touch withEvent:(UIEvent *)event
  {
    CGPoint touchPoint = [touch locationInView:[touch view]];

    touchPoint = [[CCDirector sharedDirector]convertToGL:touchPoint];
   self.position = ccp((-(currentScreen-1)*scrollWidth)+(touchPoint.x-startSwipe),0);

--> NSArray *touchArray = [touches allObjects];
if([touchArray count] > 1)
{
    UITouch *fingerOne = [touchArray objectAtIndex:0];
    UITouch *fingerTwo = [touchArray objectAtIndex:1];

    CGPoint pointOne = [fingerOne locationInView:[fingerOne view]];
    CGPoint pointTwo = [fingerTwo locationInView:[fingerTwo view]];

pointOne = [[CCDirector sharedDirector] convertToGL:pointOne];
    pointTwo = [[CCDirector sharedDirector] convertToGL:pointTwo];

    float distance = sqrt(pow(pointOne.x - pointTwo.x, 2.0) + pow(pointOne.y - pointTwo.y, …
Run Code Online (Sandbox Code Playgroud)

cocos2d-iphone

3
推荐指数
1
解决办法
4887
查看次数