我正在建立一个地图网站,如谷歌地图。将会有相互连接的图像块。将通过用鼠标拖动来探索地图,每次拖动后,将加载新图像。为了具有拖动浏览功能,我找到了两种方法:
问题是,这些方法之间是否存在性能差异?(主要是在渲染速度和拖动平滑度方面)另外,还有其他标准来选择其中一种方法吗?
我想在特定情况下捕获图像,例如按下按钮时; 但我不想显示任何视频预览屏幕.我想captureStillImageAsynchronouslyFromConnection是我需要用于此场景的东西.目前,如果我显示视频预览,我可以捕获图像.但是,如果我删除代码以显示预览,应用程序将崩溃并显示以下输出:
2012-04-07 11:25:54.898 imCapWOPreview [748:707]***由于未捕获的异常'NSInvalidArgumentException'终止应用程序,原因:'*** - [AVCaptureStillImageOutput captureStillImageAsynchronouslyFromConnection:completionHandler:] - 传递了非活动/无效连接. "***第一掷调用堆栈:(0x336ee8bf 0x301e21e5 0x3697c35d 0x34187 0x33648435 0x310949eb 0x310949a7 0x31094985 0x310946f5 0x3109502d 0x3109350f 0x31092f01 0x310794ed 0x31078d2d 0x37db7df3 0x336c2553 0x336c24f5 0x336c1343 0x336444dd 0x336443a5 0x37db6fcd 0x310a7743 0x33887 0x3382c)终止叫做抛出异常(LLDB)
所以这是我的实现:
BIDViewController.h:
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
@interface BIDViewController : UIViewController
{
AVCaptureStillImageOutput *stillImageOutput;
}
@property (strong, nonatomic) IBOutlet UIView *videoPreview;
- (IBAction)doCap:(id)sender;
@end
Run Code Online (Sandbox Code Playgroud)
BIDViewController.m中的相关人员:
#import "BIDViewController.h"
@interface BIDViewController ()
@end
@implementation BIDViewController
@synthesize capturedIm;
@synthesize videoPreview;
- (void)viewDidLoad
{
[super viewDidLoad];
[self setupAVCapture];
}
- …Run Code Online (Sandbox Code Playgroud) 我正在使用从https://github.com/brandonaaron/jquery-mousewheel/downloads下载的JQuery鼠标滚轮来获取鼠标滚轮信息.同时,我想在滚轮时获得鼠标的位置.我怎样才能做到这一点?
我目前的功能如下:
$(function() {
$('#maindiv').mousewheel(function(event, delta, deltaX, deltaY) {
// somehow obtain mouse position
// Use delta and mouse position for a purpose
});
});
Run Code Online (Sandbox Code Playgroud) avfoundation ×1
capture ×1
css ×1
draggable ×1
html ×1
ios ×1
iphone ×1
jquery ×1
mousewheel ×1
scroll ×1