<неи<неи-----Original Message-----<неиFrom: Regina Henschel
[mailto:rb.hensc...@t-online.de] <неиSent: Friday, May 10, 2013 7:15 PM<неиTo:
api@openoffice.apache.org<неиSubject: Re: insert image into
calc<неи<неиHi,<неи<неиk.misha schrieb:<неи> Hello!<неи><неи> I have this
code:<неи><неи> Reference< com::sun::star::drawing::XDrawPagesSupplier ><неи>
xDrawPagesSupplier(xCalcComponent, UNO_QUERY);<неи><неи> Reference< XDrawPages
> xDrawPages( xDrawPagesSupplier->getDrawPages(),<неи> UNO_QUERY );<неи><неи>
Reference< XDrawPage > xDrawPage( xDrawPages->getByIndex(0), UNO_QUERY
);<неи><неи> Reference< XShapes > xShapes(xDrawPage,
UNO_QUERY);<неи><неи><неи><неи> com::sun::star::awt::Point imgPoint;<неи><неи>
com::sun::star::awt::Size imgSize;<неи><неи><неи><неи> imgSize.Height =
5000;<неи><неи> imgSize.Width = 25000;<неи><неи> imgPoint.X = 6500;<неи><неи>
imgPoint.Y = 8100;<неи><неи><неи><неи> Reference<XSpreadsheetDocument>
xSheetDocument (xCalcComponent,UNO_QUERY);<неи><неи> Reference< XModel >
aDrawDoc (xSheetDocument, UNO_QUERY);<неи><неи> Reference<XChartDocument>
aChartDoc;<неи><неи> Reference<XMultiServiceFactory>
aFact(aDrawDoc,UNO_QUERY);<неи><неи> Reference< XShape > xShape(<неи>
aFact->createInstance(OUString::createFromAscii("com.sun.star.drawing.OLE2Sh<неи>
ape")), UNO_QUERY);<неи><неи><неи><неи>
xShape->setPosition(imgPoint);<неи><неи> xShape->setSize(imgSize);<неи><неи>
xDrawPage->add(xShape);<неи><неи><неи><неи> This code inserts empty ole object
into calc document with my imgSize and<неи> imgPoint.<неи<неиAs far as I see,
it inserts only a shape. You have to set the property <неиCLSID to create the
chart document itself. For a chart it is
<неиCLSID="12DCAE26-281F-416F-a234-c3086127382e"<неи<неи><неи> But how can I
set the image for this ole object?<неи<неиYou have to set the chart type and
fill the data table or the reference <неиto the data range of the spreadsheet.
That should be in Model.<неи<неи><неи> Something like this:<неи><неи>
xShape->SetUrl("C:\\1.png") or xShape->SetImage("C:\\1.png").<неи<неиI think,
the picture should be generated automatically, but I'm not sure <неиwhether a
kind of update/refresh is necessary.<неи<неиKind
regards<неиRegina<неи<неи<неи<неи---------------------------------------------------------------------<неиTo
unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org<неиFor additional
commands, e-mail: api-help@ope<неи<неи<неиRegina, I have understood how to do
it.<неиIn documentation of service with wich I initialize XShape are some
properties. <неиUsing XPropertySet and setPropertyValue I set option for XShape
like UrlPath.<неиAfter this in empty image object appears real image path of
wich I set.<неиIf you need this code, tell me please.<неи<неиRegards.<неи