com.sun.star.drawing.BitmapTable obsolet?

Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

com.sun.star.drawing.BitmapTable obsolet?

Peter Eberlein-3
Hi,

I want to insert a (non-linked) graphic into a drawpage via API.
This can be done by creating a shape and setting the property
FillBitmapURL to an internal URL.

This internal URL is stored in a BitmapTable, if it was inserted by name
before.

Now I saw, that this BitmapTable is empty, if a graphic is inserted by GUI.

So is there another way to insert pictures by API beside the BitmapTable
service?

Regards

Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: com.sun.star.drawing.BitmapTable obsolet?

Fernand Vanrie
Peter ,

You can use the graphicProvider like:

oOriginalGraph = getGraphFromUrl(sURL)

oGraphic.Graphic = oOriginalGraph

oText.insertTextContent(oDocument.getCurrentController().getViewCursor(), oGraphic,
false)

function getGraphFromUrl(sFileURL as String) as Object
   oProvider = createUnoService("com.sun.star.graphic.GraphicProvider")
   Dim oPropsIN(0)as new com.sun.star.beans.PropertyValue
   oPropsIN(0).Name  = "URL"
   oPropsIN(0).Value = sFileURL
   getGraphFromUrl = oProvider.queryGraphic(oPropsIN())
  end function

hope it helps

Fernand

> Hi,
>
> I want to insert a (non-linked) graphic into a drawpage via API.
> This can be done by creating a shape and setting the property
> FillBitmapURL to an internal URL.
>
> This internal URL is stored in a BitmapTable, if it was inserted by
> name before.
>
> Now I saw, that this BitmapTable is empty, if a graphic is inserted by
> GUI.
>
> So is there another way to insert pictures by API beside the
> BitmapTable service?
>
> Regards
>
> Peter
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: com.sun.star.drawing.BitmapTable obsolet?

Christian Lippka
In reply to this post by Peter Eberlein-3
Hi Peter,

the BitmapTable is used for bitmap fillings, which are always
embedded. Using the BitmapTable to insert embedded bitmaps for
graphic shapes was a workaround because this feature was missing
at the API.

This is now possible directly. The graphic shape supports the Property
"Graphic" which accepts an XGraphic.

To get an XGraphic from an image file use the service

com.sun.star.graphic.GraphicProvider with the method

XGraphic XGraphicProvider::queryGraphic

Regards,
Christian


Am 08.02.2011 10:30, schrieb Peter Eberlein:

> Hi,
>
> I want to insert a (non-linked) graphic into a drawpage via API.
> This can be done by creating a shape and setting the property
> FillBitmapURL to an internal URL.
>
> This internal URL is stored in a BitmapTable, if it was inserted by name
> before.
>
> Now I saw, that this BitmapTable is empty, if a graphic is inserted by GUI.
>
> So is there another way to insert pictures by API beside the BitmapTable
> service?
>
> Regards
>
> Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: com.sun.star.drawing.BitmapTable obsolet?

Peter Eberlein-3
In reply to this post by Fernand Vanrie
Hi,



Am 08.02.2011 11:21, schrieb Fernand Vanrie:

> Peter ,
>
> You can use the graphicProvider like:
>
> oOriginalGraph = getGraphFromUrl(sURL)
>
> oGraphic.Graphic = oOriginalGraph
>
> oText.insertTextContent(oDocument.getCurrentController().getViewCursor(), oGraphic,
> false)
>
> function getGraphFromUrl(sFileURL as String) as Object
> oProvider = createUnoService("com.sun.star.graphic.GraphicProvider")
> Dim oPropsIN(0)as new com.sun.star.beans.PropertyValue
> oPropsIN(0).Name = "URL"
> oPropsIN(0).Value = sFileURL
> getGraphFromUrl = oProvider.queryGraphic(oPropsIN())
> end function


sorry that I was not precise enough.

My question is about Drawing resp. Presentation documents,

Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: com.sun.star.drawing.BitmapTable obsolet?

Fernand Vanrie
Peter,

Sorry, i am a bit of a writer gui :-)

but as the other respons sugest the same technic can been used for
"shapes.graphic"

Fernand

> Hi,
>
>
>
> Am 08.02.2011 11:21, schrieb Fernand Vanrie:
>> Peter ,
>>
>> You can use the graphicProvider like:
>>
>> oOriginalGraph = getGraphFromUrl(sURL)
>>
>> oGraphic.Graphic = oOriginalGraph
>>
>> oText.insertTextContent(oDocument.getCurrentController().getViewCursor(),
>> oGraphic,
>> false)
>>
>> function getGraphFromUrl(sFileURL as String) as Object
>> oProvider = createUnoService("com.sun.star.graphic.GraphicProvider")
>> Dim oPropsIN(0)as new com.sun.star.beans.PropertyValue
>> oPropsIN(0).Name = "URL"
>> oPropsIN(0).Value = sFileURL
>> getGraphFromUrl = oProvider.queryGraphic(oPropsIN())
>> end function
>
>
> sorry that I was not precise enough.
>
> My question is about Drawing resp. Presentation documents,
>
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: com.sun.star.drawing.BitmapTable obsolet?

Peter Eberlein-3
In reply to this post by Christian Lippka
Hi Christian, hi Fernand,


Am 08.02.2011 11:25, schrieb Christian Lippka:

> Hi Peter,
>
> the BitmapTable is used for bitmap fillings, which are always
> embedded. Using the BitmapTable to insert embedded bitmaps for
> graphic shapes was a workaround because this feature was missing
> at the API.
>
> This is now possible directly. The graphic shape supports the Property
> "Graphic" which accepts an XGraphic.
>
> To get an XGraphic from an image file use the service
>
> com.sun.star.graphic.GraphicProvider with the method
>
> XGraphic XGraphicProvider::queryGraphic
>
> Regards,
> Christian


all works fine now, thanks.

Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]