4

我无法设置 Image 对象的 dpi。代码的最后一行总是向我抛出错误消息。请参见下文:

import PythonMagick
from PythonMagick import Image 
p = PythonMagick.Image()    
p.density('300')     # --> This is the line where the error occurs

错误如下:

Traceback (most recent call last):

File "<ipython-input-45-3dabab8b125b>", line 2, in <module>
p.density('300')

ArgumentError: Python argument types in
   Image.density(Image, str)
did not match C++ signature:
  density(class Magick::Image {lvalue})
  density(class Magick::Image {lvalue}, class Magick::Point)
4

0 回答 0