-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
文件mgimagesp.cpp中:
bool MgImageShape::_save(MgStorage* s) const
{
s->writeString("name", _name);
s->writeFloat("imageWidth", _size.x);
s->writeFloat("imageHeight", _size.y);
LOGE("save() ----------> name = %s", _name); //打印结果:*.jpg
LOGE("save() ----------> _size.x = %f", _size.x); //打印结果:0.000000
LOGE("save() ----------> _size.y = %f", _size.y); //打印结果:0.000000
return __super::_save(s);
}
其中_name只包含图片的名称,不包含其路径,所以导致图片加载不出来
我把代码改为:
s->writeString("name", "/sdcard/image/img01.jpg");
s->writeFloat("imageWidth", 400);
s->writeFloat("imageHeight", 300);
之后就可以加载图片了,但是加载出来的都是图片/sdcard/image/img01.jpg,请问这里应该怎么修改啊?
我不知道这里的_name,和_size.x,_size.y是从哪里传进来的?还望指教一下,不胜感激!
Metadata
Metadata
Assignees
Labels
No labels