Edit: I updated your signature for you -- MrProgrammer, forum moderator |
[Solved] Unable to fit images to cells
[Solved] Unable to fit images to cells
Hi all, I am having an issue where the anchor point for an image in the spreadsheet moves up to the next cell unless I scale the image down and place it at the bottom of the cell, leaving a gap at the top. Any ways to get the image to fill the cell while keeping the anchor point in the same cell?
I am using the latest version of open office on windows 10x64, had to put vista as no matter what I typed in my signature, it wouldn't let me sign up.
Last edited by MrProgrammer on Fri Feb 23, 2024 10:28 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved] Solutions provided; no response from sdobbie -- MrProgrammer, forum moderator
Reason: Tagged ✓ [Solved] Solutions provided; no response from sdobbie -- MrProgrammer, forum moderator
OpenOffice 4.1.15 on Windows 10
Re: Unable to fit images to cells
If I click on a cell and select the menu item Insert -> Picture -> From File, I think I get what you want. Is that what you are doing?
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: Unable to fit images to cells
You can align an image PRECISELY to a cell by some macros. (You must realign them when the cell size changed.)
Similar topic:
viewtopic.php?t=34544
Similar topic:
viewtopic.php?t=34544
Code: Select all
REM ***** BASIC *****
option explicit
Sub fitGraphics()
Dim oDoc As Object
Dim oSheet As Object
Dim oShape as Object
Dim iCount As Integer
Dim lCol, lRow as long
Dim oSize As new com.sun.star.awt.Size
Dim oPoint As new com.sun.star.awt.Point
oDoc = ThisComponent
oSheet = oDoc.CurrentController.ActiveSheet
iCount = oSheet.DrawPage.count
Do While iCount >= 1
oShape = oSheet.DrawPage(iCount - 1)
if oShape.supportsService("com.sun.star.drawing.GraphicObjectShape") then
oSize = oShape.getSize()
lCol = oShape.anchor.CellAddress.Column
lRow = oShape.anchor.CellAddress.Row
oSize.Height = oSheet.Rows(lRow).Height
oSize.Width = oSheet.Columns(lCol).Width
oShape.setSize(oSize)
oShape.setPosition(oShape.anchor.Position)
endif
iCount = iCount - 1
Loop
End Sub
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Unable to fit images to cells
Recent versions of LibreOffice Calc allow a setting >Anchor>To Cell (resize with cell) for any shape. For shapes anchored to cells (instead of "To Sheet") there is also a tool named Fit to Cell Size available from the context menu.
Having used the tool, and having set the anchor type, the shape will adapt automatically to changes of the cell size (not regarding the aspect ratio).
Having used the tool, and having set the anchor type, the shape will adapt automatically to changes of the cell size (not regarding the aspect ratio).
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München