【发布时间】:2013-05-20 07:54:50
【问题描述】:
工作:(文档有一个带有 id="img" src="img.png" 的 img 标签,并且可以工作)
void test() {
ImageElement img = query('#img');
context.drawImage(img, 0, 0);
}
不工作:
void test() {
ImageElement img = new ImageElement(src: 'img.png');
context.drawImage(img, 0, 0);
}
那么,为什么我不能使用文档中的“新 ImageElement”而不是“查询”?
【问题讨论】: