[Libreoffice-bugs] [Bug 127310] New: Base/BASIC: RectangleShape object does not display an image by setting its FillBitmap
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Tue Sep 3 12:37:42 UTC 2019
https://bugs.documentfoundation.org/show_bug.cgi?id=127310
Bug ID: 127310
Summary: Base/BASIC: RectangleShape object does not display an
image by setting its FillBitmap
Product: LibreOffice
Version: 6.2.5.2 release
Hardware: All
OS: Windows (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Base
Assignee: libreoffice-bugs at lists.freedesktop.org
Reporter: fodorbalint at gmail.com
Description:
You can add a picture to a form using com.sun.star.drawing.GraphicObjectShape,
but the picture will fill the whole area, and I want to be able to display
square images centered in a 16:9 rectangle.
com.sun.star.drawing.RectangleShape seems to be able to do it, but when I set
its FillBitmap property, no image is shown. Here is the full code:
Steps to Reproduce:
oGraphicsShape=ThisComponent.createInstance("com.sun.star.drawing.RectangleShape")
aSize=CreateUnoStruct("com.sun.star.awt.Size")
ratio=50706/1917
aSize.Width=222*ratio
aSize.Height=125*ratio
oGraphicsShape.setSize(aSize)
aPoint=CreateUnoStruct("com.sun.star.awt.Point")
aPoint.X=0
aPoint.Y=0
oGraphicsShape.setPosition(aPoint)
oGraphicsShape.FillStyle=com.sun.star.drawing.FillStyle.BITMAP
oGraphicsShape.FillBitmapLogicalSize=true
oGraphicsShape.FillBitmapSizeX=100
oGraphicsShape.FillBitmapSizeY=100
url="file:///C:/Users/fodor/OneDrive/Documents/LibreOffice
Bugs/testimage222x125.jpg"
oProvider=createUnoService("com.sun.star.graphic.GraphicProvider")
Dim args(0) as new com.sun.star.beans.PropertyValue
args(0).Name = "URL"
args(0).Value = url
oGraphicsShape.FillBitmap = oProvider.queryGraphic(args())
oGraphicsShape.AnchorType=com.sun.star.text.TextContentAnchorType.AT_PAGE
ThisComponent.DrawPage.add(oGraphicsShape)
'-------------------------------
oGraphicsShape=ThisComponent.createInstance("com.sun.star.drawing.GraphicObjectShape")
oGraphicsShape.setSize(aSize)
aPoint.Y=125 * ratio
oGraphicsShape.setPosition(aPoint)
oGraphicsShape.Graphic = oProvider.queryGraphic(args())
oGraphicsShape.AnchorType=com.sun.star.text.TextContentAnchorType.AT_PAGE
ThisComponent.DrawPage.add(oGraphicsShape)
Actual Results:
On the top left corner of the page a blue rectangle is displayed, while below
the actual picture.
Expected Results:
Two picture being displayed.
Reproducible: Always
User Profile Reset: Yes
Additional Info:
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20190903/86abf80e/attachment.html>
More information about the Libreoffice-bugs
mailing list