我有这个EPPlus代码在第5 / E行第1行的Excel电子表格上放置位图:
NameError: name 'SCons' is not defined:
File "/Users/KangSengGil/Documents/iotivity-1.1.0/SConstruct", line 28:
SConscript('build_common/SConscript')
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 604:
return method(*args, **kw)
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 541:
return _SConscript(self.fs, *files, **subst_kw)
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 250:
exec _file_ in call_stack[-1].globals
File "/Users/KangSengGil/Documents/iotivity-1.1.0/build_common/SConscript", line 386:
env.SConscript(target_os + '/SConscript')
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 541:
return _SConscript(self.fs, *files, **subst_kw)
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 250:
exec _file_ in call_stack[-1].globals
File "/Users/KangSengGil/Documents/iotivity-1.1.0/build_common/android/SConscript", line 241:
SConscript(env.get('SRC_DIR') + '/extlibs/boost/SConscript')
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 604:
return method(*args, **kw)
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 541:
return _SConscript(self.fs, *files, **subst_kw)
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 250:
exec _file_ in call_stack[-1].globals
File "/Users/KangSengGil/Documents/iotivity-1.1.0/extlibs/boost/SConscript", line 35:
raise SCons.Errors.EnvironmentError(msg)
图像是.png文件,其尺寸显示为(108X84)。
虽然图像应显示在第1行和第5列的交叉点,但它实际上更像第2行和第6列:
为什么,以及如何纠正这个问题?
注意:Excel列和行索引是从1开始的(不是0)。
答案 0 :(得分:1)
也许AddImage正在寻找行/列的索引而不是行/列号。如果是这种情况,那么您将行/列计为0,1,2,3,4等。
如果从当前值中减去一个,那么你应该没问题。使用索引来引用列表或网格中的位置是相对常见的,所以我认为这是一个安全的赌注。