It is the fact that the image is actually resized to its original size to gets its original height . Note: There is one problem with this method. The line below resizes the image back to the initial height: The code below resizes the picture to its original size and gets the height of the original picture: = lngPercent2Scale * lngScaledHeight / lngOriginalHeight LngScaledHeight / lngOriginalHeight * 100 LngOriginalHeight = InlineShapes.Item(1).Height LngScaledHeight = InlineShapes.Item(1).Height Scale the image back to its initial size.Scale the image back to its original size.One method for overcomming this would be to follow the algorithm below: In the figure below you can see the image in its full scale: The picture was rescaled upon inserting into the document. The reason for this is because the original picture size is almost twice the size of the current picture. Upon running the code below we would expect the height of the image to be reduced by 30 percent, but instead the image becomes longer in height: Note that if not resized by the user, larger picture are resized by default upon being inserted in the word document.įor example take a look at the figure below: The problem with the code above is that the picture is scaled relative to its original size. The following code resizes the picture width to 40% of the original picture width: The following code resizes the picture height to 90% of the original picture height: ScaleWidth property of their associated shape container. This property determines the size in percent relative to the original picture size to scale the image.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |