Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

stretching image

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
anukeen
29167 Views, 9 Replies

stretching image

Hello,

 

Is there a way to stretch an image?  Not scale.  Put simply, I have attached a square jpg, and I want to strech it to fit inside a rectangle.  Possible?

 

Thanks!

 

Anu

9 REPLIES 9
Message 2 of 10
3wood
in reply to: anukeen

1. Make a block from the image.

2. Select the block and change its "Scale X" or "Scale Y" to suit the rectangle, as shown below.

image 1.PNG

 

Result:

image 2.PNG

 

Message 3 of 10
anukeen
in reply to: 3wood

Thank you.  But is there a simpler way to just fit the rectangle as a reference??

Message 4 of 10
3wood
in reply to: anukeen

No.

Message 5 of 10
gguevarra
in reply to: anukeen

You could try scaling it when you first insert / xref in the image. The insertion point is typically the bottom left corner of the image. Once you click the base point, you can either type in a numerical scale value, or move the mouse around to adjust the scale of the image. Not sure if this will solve your problem, but hopefully it's something.

Message 6 of 10
pendean
in reply to: anukeen

Images do not stretch in AutoCAD: that's why turning them into a block is required first.
Message 7 of 10
doni49
in reply to: anukeen

Try this LISP routine.  It basically boils all that down into one "command".  It will prompt you to select the image.  Then it will prompt for five points as shown in the first screenshot.  Then the result will be similar to the second screenshot.

 

(defun c:imgScale( / pt1 ptx1 ptx2 pty1 pty2 ip bname cnt ent)
  (setq ent nil)
  (while (not ent)
    (setq cnt -1)
    (setq ent(car(entsel "Select Image:  ")))
    (if (EQ "IMAGE" (cdr(assoc 0 (entget ent))))
      (progn
        (while (not bname)
          (setq bname (strcat "direlandimage" (itoa(setq cnt (1+ cnt)))))
          (if (tblsearch "block" bname) (setq bname nil))
        )
        (setq ip (cdr(assoc 10 (entget ent))))
        (setq Pt1 (getpoint "Select Basepoint:  "))(setq Ptx1 (getpoint "select X Point on Image:  "))(setq ptx2 (getpoint "Select X Point Destination:  "))(setq pty1 (getpoint "Select Y Point on Image:  "))(setq pty2 (getpoint "Select Y Point Destination:  "))
        (command ".-block" bname ip ent "" 
                 ".-insert" bname ip (/ (distance pt1 Ptx2)(distance pt1 Ptx1))(/ (distance pt1 Pty2)(distance pt1 Pty1)) 0.0
                 ".explode" (entlast) ""
                 ".-purge" "b" bname "n"
        )
      );end True Progn
      (progn 
        (Princ "Image required.  Try again")
        (setq ent nil)
      );End False Progn
    );end if
  );end while
)

 

ImageScale.png

 

ImageScale2.png

 



Don Ireland
Engineering Design Technician




If a reply solves your issue, please remember to click on "Accept as Solution". This will help other users looking to solve a similar issue. Thank you.


Please do not send a PM asking for assistance. That's what the forums are for. This allows everyone to benefit from the question asked and the answers given.

Message 8 of 10
ddillow
in reply to: 3wood

It seems that after scaling, one can explode the block and the image retains its new proportions. 🙂


@3wood wrote:

1. Make a block from the image.

2. Select the block and change its "Scale X" or "Scale Y" to suit the rectangle, as shown below.

image 1.PNG

 

Result:

image 2.PNG

 


 

Message 9 of 10
riyaagarwal1601
in reply to: ddillow

Hi i wanted to know how can i extend the image in autocad 2006. dont want to scale but how to extend the rectangular image in sqaure

Message 10 of 10

Hi,

 

>> wanted to know how can i extend the image in autocad 2006. dont want to scale

As you have read the posts above, images can only be modified to a different aspect ratio using the block-scale-X workaround.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost