you always need to convert a system path to a URL (i think :-) )
use the "ConvertToUrl" function what will result in
"file:///images/apple.png"
Hope it helps
Greetz
Fernand
On 30/11/2017 13:09, Rushna Jabi wrote:
Hi all,
I am working on OpenOffice plugin using NetBeans 8.0.2.
I have created a dialog using XDialog and now I want add image on this
dialog.
but I am not getting image.
My code is:
//create the image model and set the properties
Object imageModel =
xMultiServiceFactory.createInstance("com.sun.star.awt.UnoControlImageControlModel");
XPropertySet imageProperties = (XPropertySet)
UnoRuntime.queryInterface(XPropertySet.class, imageModel);
imageProperties.setPropertyValue("PositionX", new Integer(0));
imageProperties.setPropertyValue("PositionY", new Integer(0));
imageProperties.setPropertyValue("Width", new Integer(150));
imageProperties.setPropertyValue("Height", new Integer(150));
imageProperties.setPropertyValue("Name", name);
imageProperties.setPropertyValue("ScaleImage", new Boolean(true));
imageProperties.setPropertyValue("ImageURL", new
String("/images/apple.png"));
// insert the control models into the dialog model
XNameContainer xNameCont = ( XNameContainer
)UnoRuntime.queryInterface( XNameContainer.class, dialogModel );
xNameCont.insertByName(name, imageModel);
I am not getting image on Dialog using relative path.
I need your support, please help me.
Thanks & regards,
Rushna Jabi
Software Engineer
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org
For additional commands, e-mail: dev-h...@openoffice.apache.org