You are viewing a plain text version of this content. The canonical link for it is here.
Posted to api@openoffice.apache.org by Jörg Schmidt <jo...@j-m-schmidt.de> on 2014/10/15 07:31:44 UTC

access internal graphics of a writer-document

Hello,

With the StarBasic-Code: 

ThisComponent.GraphicObjects(0).GraphicURL

I can read the internal URL of an embedded graphic in a writer-document, for example "vnd.sun.star.GraphicObject:10000000000003AC000000DC178CAB87" 

But can I use this URL as ".GraphicURL" for a graphic control of a dialogue? If so, How?

What I mean is that "vnd.sun.star.GraphicObject:10000000000003AC000000DC178CAB87" is not the correct form of the URL what is needed for a graphics control, because this would be, for example:
file:///C:/Users/xxx/Desktop/Hintergrund.png

(or: "C:\Users\Internet\Desktop\Hintergrund.png")



please note: 
my document is unsaved, so I can not directly access the pictures folder in the *.odt file.



Greetings,
Jörg



---------------------------------------------------------------------
To unsubscribe, e-mail: api-unsubscribe@openoffice.apache.org
For additional commands, e-mail: api-help@openoffice.apache.org


Re: access internal graphics of a writer-document

Posted by Jörg Schmidt <jo...@j-m-schmidt.de>.
Hello Arial, 

> From: Ariel Constenla-Haile [mailto:arielch@apache.org] 

> I guess you are using the Dialog Editor, I've tried the Property
> Browser, and it does not work well with this protocol: setting
> "Graphics" to
> vnd.sun.star.GraphicObject:10000201000001B10000019D1E3B87B7 is then
> converted to lower case, "graphicobject", which does not work.

Oh yes, i see

> > please note: my document is unsaved, so I can not directly 
> access the
> > pictures folder in the *.odt file.
> 
> You can set the ImageURL property of the control model, it works with
> "vnd.sun.star.GraphicObject:" protocol.

fine thank you

The following code works in my case:

frm_jms = DialogLibraries.Standard.Dialog1
dia_jms = CreateUnoDialog(frm_jms)
dia_jms.getControl("ImageControl1").Model.ImageURL = _
"vnd.sun.star.GraphicObject:10000000000003AC000000DC595EAE83"
dia_jms.execute


Greetings,
Jörg



---------------------------------------------------------------------
To unsubscribe, e-mail: api-unsubscribe@openoffice.apache.org
For additional commands, e-mail: api-help@openoffice.apache.org


Re: access internal graphics of a writer-document

Posted by Ariel Constenla-Haile <ar...@apache.org>.
Hello Jörg,

On Wed, Oct 15, 2014 at 07:31:44AM +0200, Jörg Schmidt wrote:
> Hello,
> 
> With the StarBasic-Code: 
> 
> ThisComponent.GraphicObjects(0).GraphicURL
> 
> I can read the internal URL of an embedded graphic in
> a writer-document, for example
> "vnd.sun.star.GraphicObject:10000000000003AC000000DC178CAB87" 
> 
> But can I use this URL as ".GraphicURL" for a graphic control of
> a dialogue? If so, How?

Yes, you can. If the graphic inside the zip file is located in
Pictures/10000201000001B10000019D1E3B87B7.png use
vnd.sun.star.GraphicObject:10000201000001B10000019D1E3B87B7 that is the
protocol vnd.sun.star.GraphicObject: and the file name without the
extension (the image ID).

> 
> What I mean is that
> "vnd.sun.star.GraphicObject:10000000000003AC000000DC178CAB87" is not
> the correct form of the URL what is needed for a graphics control,
> because this would be, for example:
> file:///C:/Users/xxx/Desktop/Hintergrund.png
> 
> (or: "C:\Users\Internet\Desktop\Hintergrund.png")

I guess you are using the Dialog Editor, I've tried the Property
Browser, and it does not work well with this protocol: setting
"Graphics" to
vnd.sun.star.GraphicObject:10000201000001B10000019D1E3B87B7 is then
converted to lower case, "graphicobject", which does not work.

> please note: my document is unsaved, so I can not directly access the
> pictures folder in the *.odt file.

You can set the ImageURL property of the control model, it works with
"vnd.sun.star.GraphicObject:" protocol.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina