Unplanned
Last Updated: 06 Mar 2017 14:02 by ADMIN
ADMIN
Deyan
Created on: 02 Mar 2017 13:55
Category: WordsProcessing
Type: Bug Report
1
WordsProcessing: Image SetWidth and SetHeight methods ignore respectLockAspectRatio parameter when the size is not set explicitly
This is caused by hasSize field in ShapeBase class which is set when decoding the image size. However, when SetWidth and SetHeight methods are called before the size is initialized the value of hasSize is false which causes the issue.

Workaround: Call the Size property getter before calling SetWidth/SetHeight method. See the code below:

// This line workarounds the issue with SetWidth method which does not get the correct size when locking aspect ratio. 
Size size = imageInline.Image.Size;
imageInline.Image.SetWidth(true, width);
0 comments