0

I notice 'The IMAGE entity is like a block reference, you can use it multiple times to add the image on different locations with different scales and rotations.' in the introduction of class 'Image'(see : https://ezdxf.readthedocs.io/en/master/dxfentities/image.html ).But I can not find any parameter to resize the image. For example,the original size of the image is (3000x1691),and when I use AutoCAD to load the dxf file with this image,I hope its size is (101x57).Could anybody tell me how to do that?Sorry for my poor English. Here is my code:


dwg = ezdxf.readfile('AC1015.dxf')# 2010

msp = dwg.modelspace()

imageWidth, imageHeight = get_image_size(imageFilePath)

#create layout
dwg.layers.new(name=layoutName, dxfattribs={'color': layoutColor})
my_layout = dwg.layers.get(layoutName)

my_image_def = dwg.add_image_def(filename=imageFilePath, size_in_pixel=(imageWidth,imageHeight))
my_image_def.dxf.resolution_units = 2

image_ = msp.add_image(insert=ucs.origin, size_in_units=(1,1),
                           image_def=my_image_def, rotation=0, dxfattribs={'layer': layoutName})

#save file
dwg.saveas(dxfoutfile)

I tried to change 'size_in_pixel' and 'size_in_units',but it didn't work. I 'd appreciate it if you could help me.

ZackWann
  • 1
  • 1

0 Answers0