We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

XlsIO Image Marker, fixed height not width

I need to set the image %Reports.Image;size:60 will set image width to 60 and height is not fixed, but I need to do opposite, I need to define height not width, it should be calculated itself by ratio. Is there any way to do that ?

3 Replies

AV Abirami Varadharajan Syncfusion Team September 3, 2019 05:33 PM UTC

Hi John, 

Greetings from Syncfusion. 

While applying marker with image using size argument, you need to specify both height and width. When width value is only given, it considers the width value as height’s value. So, we request you to specify the width by using below calculation to achieve your requirement. 
 
Code Example: 
float height = 80; 
float width = (float)(height * height / 100.0); 
worksheet["A4"].Text = "%Reports.Image;size:" + width + "," + height; 
 
Please refer to below documentation to know about the syntax of Image arguments and its purpose in detail. 

 
Regards, 
Abirami 



JO John replied to Abirami Varadharajan September 3, 2019 05:52 PM UTC

Hi John, 

Greetings from Syncfusion. 

While applying marker with image using size argument, you need to specify both height and width. When width value is only given, it considers the width value as height’s value. So, we request you to specify the width by using below calculation to achieve your requirement. 
 
Code Example: 
float height = 80; 
float width = (float)(height * height / 100.0); 
worksheet["A4"].Text = "%Reports.Image;size:" + width + "," + height; 
 
Please refer to below documentation to know about the syntax of Image arguments and its purpose in detail. 

 
Regards, 
Abirami 


that defeats the purpose of template marker, first I have to find the cell that has the required image marker, then replace its text for height and width.
Why not just place the image there by code instead of using marker.

You should add the auto ratio feature in future release.


AV Abirami Varadharajan Syncfusion Team September 4, 2019 02:11 PM UTC

Hi John, 
 
We consider your requirement for “Applying marker image with auto ratio” and logged a feature report for the same. We will include the implementation in our upcoming release which will be available by end of September 2019. 
 
You can track the status of the feature through the following feedback. 
 
 
Regards, 
Abirami. 


Loader.
Up arrow icon