Quick-x IOS截图分享问题

参考2.2.3的umeng_share栗子做截图分享,在quick层使用printscreen截图

local args = {}
args.file = “image.png”
local temp = CCDirector:sharedDirector():getRunningScene()
local sp,file = display.printscreen(temp,args)

然后把路径和图片名作参数传到umeng_share_sdk
cc.share:doCommand{command = “shareImg”, args = {shareText = “哈哈!我今天向上爬了” … self.Score … “层!欢迎各路大神挑战我的成绩!”, shareImg = device.writablePath … “image.png”}}

在安卓平台下分享正常,但在IOS平台下share的时候
UIImage imageNamed:截图路径+名
得到空对象…

请问各位大牛这是什么原因呢?如何解决呢?谢谢

device.writablePath … “image.png” 如果这个图片存在的话,这个是IOS上层接口调用问题, 应该使用UIImage imageWithContentsOfFile

谢谢大牛…问题解决了…的确用imageWithContentsOfFile 才可以生成正确的图片…
但有个问题不是很理解,我有两处分享,一个是用res/目录下的图片分享的,就必须UIImage imageNamed,而这个截图的就必须imageWithContentsOfFile,这是为什么呢?

上层接口决定的。ipa自带的图片是用 UIImage imageNamed, 启动游戏后产生的图片就得用imageWithContentsOfFile

哦哦~明白了…谢谢大牛指点~!!!