是否可以通过电缆(USB)连接将签名从iPhone传输到.xls文件?iPhone签名捕获
4
A
回答
7
所以,这可能不是你正在寻找的,但这是我如何捕捉用户(用他们的手指/手写笔)绘制的签名。您的UIImageView将具有绘制的签名。我没有想过如何将签名图像传输到.xls,但可以将图像保存到设备的照片库中,然后像导出其他图像一样将其导出,然后将其放入.xls(我知道,这是一本手册处理)。我希望这有帮助。
SignatureViewController.h
IBOutlet UIImageView *signatureImageView;
//Signature Drawing Items
CGPoint lastPoint;
BOOL mouseSwiped;
int mouseMoved;
SignatureCaptureViewController.m
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
mouseSwiped = NO;
UITouch *touch = [touches anyObject];
//Clear Signature on Double Tap
if ([touch tapCount] == 2) {
signatureImageView.image = nil;
return;
}
lastPoint = [touch locationInView:signatureImageView];
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
mouseSwiped = YES;
UITouch *touch = [touches anyObject];
CGPoint currentPoint = [touch locationInView:signatureImageView];
UIGraphicsBeginImageContext(signatureImageView.frame.size);
[signatureImageView.image drawInRect:CGRectMake(0, 0, signatureImageView.frame.size.width, signatureImageView.frame.size.height)];
CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 2.0);
CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 0.0, 0.0, 0.0, 1.0);
CGContextBeginPath(UIGraphicsGetCurrentContext());
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), currentPoint.x, currentPoint.y);
CGContextStrokePath(UIGraphicsGetCurrentContext());
signatureImageView.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
lastPoint = currentPoint;
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
//Clear Signature on Double Tap
if ([touch tapCount] == 2) {
signatureImageView.image = nil;
return;
}
if(!mouseSwiped) {
UIGraphicsBeginImageContext(signatureImageView.frame.size);
[signatureImageView.image drawInRect:CGRectMake(0, 0, signatureImageView.frame.size.width, signatureImageView.frame.size.height)];
CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 2.0);
CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 0.0, 0.0, 0.0, 0.0);
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
CGContextStrokePath(UIGraphicsGetCurrentContext());
CGContextFlush(UIGraphicsGetCurrentContext());
signatureImageView.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}
}
+0
这似乎很棒。我很想看到完整的.h,并且更多地介绍如何通过界面生成器实际整合这个。 – radven 2012-06-28 06:13:27
相关问题
- 1. iPhone签名捕获
- 2. iphone SDK:如何实现签名捕获?
- 3. Android签名捕获
- 4. 签名垫:捕获多个签名
- 5. 从wpf捕获签名
- 6. PhoneGap中的签名捕获
- 7. 如何捕获标签名称?
- 8. 在Windows Mobile手机中签名捕获?
- 9. 使用phonegap的android的签名捕获
- 10. 捕获模式更改回调签名
- 11. 需要实现签名捕获
- 12. 捕获手写签名的HTML控件
- 13. 保存签名捕获为JPG
- 14. 捕获iPhone/iPad页数
- 15. Iphone屏幕视频捕获
- 16. 快速iphone屏幕捕获
- 17. 在iPhone中捕获视频
- 18. iphone renderInContext未捕获iAd
- 19. 捕获视频和iphone
- 20. Curses :: UI :: Grid标签捕获
- 21. 在标签上捕获WM_LBUTTONDOWN?
- 22. iPhone代码签名错误
- 23. 发送一个签名捕获到PDF与PDF(数据网址)
- 24. 如何从数字化平板电脑捕获签名?
- 25. 使用bezier时的签名捕获缺陷
- 26. Chrome屏幕外标签捕获API和扩展白名单
- 27. 带/不带捕获变量的lambda之间的签名区别?
- 28. 在iOS应用程序中捕获签名
- 29. FileMaker Pro: - 在Windows中签名文档捕获
- 30. 捕获和持续的电子垫/签名
什么样的签名? – 2010-11-09 14:03:54
来自应用的签名,如autogragh。例如一位签署收货的客户。 – 2010-11-09 14:46:22
您正在寻找一种方法来捕获签名,或者只有通过标准附件端口/ USB将它从应用程序导出到Excel的方式? – JWD 2010-11-09 16:07:33