系统:mac osx。现用摄像头获取到了数据,怎么才能以视频的方式显示出来,是把获取到的每祯以图像的方式放到bitmap里面绘画出来??要使用到那些图像处理类??选那种view作画布比较好???

解决方案 »

  1.   

    我 这样做哪里不对??能不能用这种设置图像的方式来显示视频???
        if(getFrame(handle, _pBuffer, 0))
        {
          NSData *data = [NSData dataWithBytes:_pBuffer length:sizeof(_pBuffer )];
          
          // Update the display Area to redraw the new frame
          NSBitmapImageRep *bitmapRep = [NSBitmapImageRep imageRepWithData:data];      NSImage *image = [[NSImage alloc] initWithCGImage:[bitmapRep CGImage] size:NSMakeSize(_iWidth,_iHeight)];
          [_frameView setImage:image];      [image release];
        }
      }