Iphone 如何通过http将签名图像从Ipad发送到服务器系统?

Iphone 如何通过http将签名图像从Ipad发送到服务器系统?,iphone,ipad,jakarta-ee,Iphone,Ipad,Jakarta Ee,我想寄一份表格,详细说明姓名、年龄等。。并将此人的签名作为图像从Ipad发送到java web应用程序服务器 [http://192.168.1.100:8080/Intranet/checkforimage.htm?name=meena&image=**][1] 我想知道如何通过http将图像从ipad发送到服务器 因为服务器端编码是用java编写的。我很乐意接受和使用 但问题是如何将Ipad中的图像转换为bytearray并通过HTTP发送 请帮忙 您可以执行以下操作: 1在填写所有详细信息

我想寄一份表格,详细说明姓名、年龄等。。并将此人的签名作为图像从Ipad发送到java web应用程序服务器

[http://192.168.1.100:8080/Intranet/checkforimage.htm?name=meena&image=**][1]

我想知道如何通过http将图像从ipad发送到服务器

因为服务器端编码是用java编写的。我很乐意接受和使用

但问题是如何将Ipad中的图像转换为bytearray并通过HTTP发送


请帮忙

您可以执行以下操作:

1在填写所有详细信息后捕获表单的屏幕截图,并将其保存为UIImage对象。您可以使用以下功能捕获屏幕快照:

}

2将UIImage对象转换为NSData对象。3使用NSURLConnection将NSData发送到服务器。

确定尝试以下代码:

NSData*imageData=UIIMAGEPNGRempresentationImage

这将以NSData的形式返回UIImage对象的PNG表示

如果您的图像是JPEG或JPG,则可以使用以下选项:

NSData*imageData=UIImageJPEGRepresentationimage,1.0


您可以使用NSURLConnection将此图像数据直接发送到服务器。

Nitni。。我不想拍任何屏幕截图。假设我在Ipad中有一个图像,我需要以字节数组的形式更改它。我该怎么做。如果你能给出代码片段,那就太好了。请看我的其他答案。如果你对iPhone有任何问题,可以随时拨打092748562与我联系。

- (UIImage*)screenshot 
{

CGSize imageSize = [[UIScreen mainScreen] bounds].size; if (NULL != UIGraphicsBeginImageContextWithOptions) UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0); else UIGraphicsBeginImageContext(imageSize); CGContextRef context = UIGraphicsGetCurrentContext(); for (UIWindow *window in [[UIApplication sharedApplication] windows]) { if (![window respondsToSelector:@selector(screen)] || [window screen] == [UIScreen mainScreen]) { CGContextSaveGState(context); // Center the context around the window's anchor point CGContextTranslateCTM(context, [window center].x, [window center].y); // Apply the window's transform about the anchor point CGContextConcatCTM(context, [window transform]); // Offset by the portion of the bounds left of and above the anchor point CGContextTranslateCTM(context, -[window bounds].size.width * [[window layer] anchorPoint].x, -[window bounds].size.height * [[window layer] anchorPoint].y); // Render the layer hierarchy to the current context [[window layer] renderInContext:context]; // Restore the context CGContextRestoreGState(context); } } // Retrieve the screenshot image UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return image;