简体   繁体   English

PhoneGap屏幕截图插件返回base64编码的字符串(iPhone)

[英]PhoneGap screenshot plugin return base64 encoded string (iPhone)

I'm using PhoneGap & Sencha Touch to develop an app. 我正在使用PhoneGap和Sencha Touch开发应用程序。 I'm trying to get the app to take a screenshot of the current view and save that image to the photo album but also to return a base64 encoded string, which we'll use to share & email the image. 我正在尝试让该应用获取当前视图的屏幕截图,并将该图像保存到相册中,还返回一个base64编码的字符串,我们将使用它来共享和通过电子邮件发送图像。 I can't get the code to return the base64 encoded string. 我无法获取返回base64编码字符串的代码。 Can anyone see anything wrong in the code? 谁能在代码中看到任何错误?

http://app.kodery.com/profile/360 ScreenShot.m the jsCallBack doesn't seem to receive anything. http://app.kodery.com/profile/360 ScreenShot.m jsCallBack似乎什么都没收到。

Any pointers would be really helpful. 任何指针将非常有帮助。

Thanks 谢谢

Prad 普拉德

It's much easier to help you if you put your code in the question rather than on another site. 如果您将代码放在问题中,而不是放在另一个站点上,则对您的帮助要容易得多。 I don't think this line is correct: 我认为这行是不正确的:

 jsCallBack = [ NSString stringWithFormat:@"%@("%@");", successCallback, encodedString ];

The quotes around stringWithFormat are not correct, not sure if this is a problem with the tool you're pasting your code into, or the code itself. stringWithFormat周围的引号不正确,不确定这是否是您将代码粘贴到的工具或代码本身的问题。 Also what is the size of imageData and what happens if you do an NSLog() for encodedString: NSString *encodedString = [imageData base64EncodedString]; 另外,imageData的大小是多少,如果对encodeString做NSLog(),会发生什么情况:NSString * encodedString = [imageData base64EncodedString]; Is there actually data there and it's not making it back to your JS? 那里确实有数据,并且没有将其返回给您的JS吗? Or is their no data in the native code? 还是它们的本机代码中没有数据?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM