Positioning images with Smart Markers

Hello,

I need to insert an image on a cell with a border.

I’m trying to insert the image into a cell with a ‘picture’ smart marker like this:
&=$ImageName(Picture:FitToCell)

  • With the tag “FitToCell” The picture doesn’t fit exactly into the cell and is always smaller than the cell. It is normal ? (the base image is larger than the cell)

  • Is there a way to position the picture manually using a smart marker? I tried to force the image size with " Picture:Width:Nin&Height:Nin" and the image is actually positioned on the border. I need to position image just under the border.

  • Is there a way to center the image into the cell with Smart Markers options ?

There is an exemple of image position when I insert an image with Smart Marker “&=$ImageName(Picture:FitToCell)”

asposecells-fittocell.png (410 Octets)

Thanks in advance,
Jules

@Julesdcp,

Yes, it is expected. “Picture:FitToCell” will auto-fit the image to the cell’s row height and column width accordingly.

You can try to specify Left and Top positions (in points) as well when defining image markers.
e.g.,

&=$ImageName(Picture:Left:5pt&Top:3pt&Width:.30in&Height:.35in)
1 Like

We are using this example to try and place an image in a merged cell. The cell consists of 5 merged columns and 18 merges rows.

All of the options (Top, Width, Height) are working, but Left seems to no effect.

The smart marker text is a follows: &=ImageData.TestImage(Picture:Left:20pt&Top:10pt&Width:3.25in&Height:3.25in)

We are using Cells version 24.4.0

Looks as though this is a defect in the library.

@TimothyBlue,

Could you please share a sample application (source code without compilation errors) and sample Excel file(s) (e.g., input Excel template file (if any) and output file) to reproduce the issue? We will check it soon.

I will put something together, but I have discovered the limitation.

When you have merged cells you can only position the image as far as the limit of the top left merged cell.

So if you have 5 merged columns, the left parameter is bound by the width of the first merged column, and if you have merged rows, the top parameter is bound by the height of the top merged row.

@TimothyBlue,

Yes, your understanding is correct. Since the merged area involves multiple cells in rows and columns and is the resultant cell, so you have to evaluate and accumulate each and every parameter (left, top, width, height, etc.) for all the cells in that merged range/area by yourselves.