openoffice-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "K.Misha" <>
Subject RE: insert image into calc document
Date Tue, 06 Aug 2013 18:03:47 GMT
Sorry, but i don't know english very well and i can't express my opinion in
an affordable manner.<неиI want to leave image in file body of calc
document. Code that i wrote here only leaves a link to image like
'D:\image.jpeg'.<неиBut i want to insert image how it insert
<неи<неиCan you help me in this
question?<неи<неиThanks.<неи<неи-----Original Message-----<неиFrom:
Douglas Pitonyak [] <неиSent: Tuesday, August 06,
2013 6:58 PM<неиTo:<неиSubject: Re: insert image
into calc document<неи<неиInteresting question....<неи<неиWhen you
your image into the document, it then has an internal <неиURL. The question
is.... how to remove the image from the GUI and leave <неиit in the
file.<неи<неи<неиOn 08/05/2013 12:21 PM, K.Misha wrote:<неи>  
From: K.Misha []<неи> Sent: Monday, August 05, 2013
7:21 PM<неи> To: ''<неи> Subject: insert image into
document<неи><неи>   <неи><неи> Hello!<неи><неи>
  <неи><неи> I have a
problem with inserting image into calc document!<неи><неи> I'm doing it
way:<неи><неи>   <неи><неи> void insertImage( imgPosition
iPos, imgSize
iSize, char * imgUrl )<неи><неи> {<неи><неи> Reference<
com::sun::star::drawing::XDrawPagesSupplier ><неи>
xDrawPagesSupplier(xCalcComponent, UNO_QUERY);<неи><неи>        Reference<
XDrawPages > xDrawPages(<неи> xDrawPagesSupplier->getDrawPages(), UNO_QUERY
);<неи><неи>        Reference< XDrawPage > xDrawPage(
xDrawPages->getByIndex(irSheet),<неи> UNO_QUERY );<неи><неи>
Reference< XShapes > xShapes(xDrawPage, UNO_QUERY);<неи><неи>   <неи><неи>
com::sun::star::awt::Point imgPoint;<неи><неи>
com::sun::star::awt::Size imgSize;<неи><неи>   <неи><неи>
imgSize.Height = iSize.h;<неи><неи>        imgSize.Width =
iSize.w;<неи><неи>      imgPoint.X = iPos.x;<неи><неи>
     imgPoint.Y =
iPos.y;<неи><неи>        ////////the size in 100/th mm<неи><неи>
<неи><неи>        Reference<XSpreadsheetDocument> xSheetDocument<неи>
(xCalcComponent,UNO_QUERY);<неи><неи>      Reference< XModel > aDrawDoc
(xSheetDocument, UNO_QUERY);<неи><неи>
Reference<XMultiServiceFactory> aFact(aDrawDoc,UNO_QUERY);<неи><неи>
Reference< XShape > xShape(<неи>
<неи> cObjectShape")), UNO_QUERY);<неи><неи>        //Reference<
XShape >
xShape( xShapes->getByIndex(0), UNO_QUERY);<неи><неи>   <неи><неи>
Reference<XPropertySet> rColProps(xShape, UNO_QUERY);<неи><неи>  
char * img = imgUrl;//"file:///D:/getImage3.jpeg";<неи><неи>        int
wchar_t *cImg = (PWSTR)HeapAlloc(GetProcessHeap(), 0,<неи> nLenOfWideCharStr
* sizeof(WCHAR));<неи><неи>   <неи>
и><неи>   <неи><неи>        OUString sstring = cImg;<неи><неи>
<неи> ")), makeAny(sstring));<неи><неи>   <неи>
<неи> makeAny(sstring));<неи><неи>   <неи><неи>
xShape->setSize(imgSize);<неи><неи>        xDrawPage->add(xShape);<неи><неи>
}<неи><неи>   <неи><неи> //////////////////////////////////////<неи><неи>
But every time when i open this calc document, image must be in this path
-<неи> imgUrl. How can i insert image into file body of calc
document?<неи><неи>   <неи><неи> Thanks!<неи><неи><неи<неи--
Pitonyak<неиMy Macro Document:<неиInfo:<неи<неи<неи----------------------------------
-----------------------------------<неиTo unsubscribe, e-mail:<неиFor additional commands, e-mail:<неи<неи

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message