Code to find a cell contains image or pic

Discuss the spreadsheet application

Code to find a cell contains image or pic

Postby Nayan9245 » Fri Jan 11, 2019 9:12 am

Hi,

I have used a code to find the cell intersects with any image or picture or not . Can any one design a code to do the same in libre-office
OpenOffice 3.1 on Windows Vista
Nayan9245
 
Posts: 1
Joined: Thu Jan 10, 2019 5:06 pm

Re: code to find a cell contains image or pic

Postby Lupp » Fri Jan 11, 2019 8:29 pm

Welcome to the community with your first post in this forum.

Cells never contain images. The images are added to the DrawPage of the respective spreadsheet. Calc itself doesn't worry much about the positional relations between images / shapes and cell areas. You would need to calculate a lot based on the API to get your intersection info. (You didn't clearly regard the difference between "contains" (within its area) and "intersects". Please clarify.)
On Windows 10: LibreOffice 6.1 and older versions, PortableOpenOffice 4.1.5 and older, StarOffice 5.2
---
Let's create a powerful UFO: United Free Office!
Lupp from München
User avatar
Lupp
Volunteer
 
Posts: 2308
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: code to find a cell contains image or pic

Postby Zizi64 » Fri Jan 11, 2019 9:52 pm

Maybe you can operate with the anchor and the aligning:

viewtopic.php?f=9&t=34544
Tibor Kovacs, Hungary; LO4.4.7, LO6.1.5 on Win7-10 x64Prof.
PortableApps, winPenPack: LO3.3.0-6.2.0 and AOO4.1.5
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.
User avatar
Zizi64
Volunteer
 
Posts: 7700
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Code to find a cell contains image or pic

Postby Lupp » Fri Jan 11, 2019 11:11 pm

You may play with the attached erxample. It contains a few graphical elements and code intersecting their areas with the cell grid. The results are written into consecutive rows of columns A:C.
For any shape the rectangular hull is the effective area.
I did no research concerning hidden rows and columns or concerning merged cell areas. Have a lot of fun.
Attachments
aoo96546GraphicIntersectCellRange_1.ods
(49.58 KiB) Downloaded 5 times
On Windows 10: LibreOffice 6.1 and older versions, PortableOpenOffice 4.1.5 and older, StarOffice 5.2
---
Let's create a powerful UFO: United Free Office!
Lupp from München
User avatar
Lupp
Volunteer
 
Posts: 2308
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany


Return to Calc

Who is online

Users browsing this forum: No registered users and 46 guests