Thanks Frank,
You just gave me the answer I needed.
(That it is not possible) So I can go on ahead with my exploration for
a good solution.
I will submit this issue somewhere on the openoffice.org website.
However the downside is, that this now means that I have to do it
without OO.o, because even if I get this working, I also need it to
work in a report.
And I guess this isn't going to work either, or do you have an idea on
how to go about that. The thing is, that I want to automatically print
all passes from a database that haven't been printed yet. (Ant the
information on thos passes include a photo).

Thanks in advance,

Willem

On 5/19/06, Frank Schönheit - Sun Microsystems Germany
<[EMAIL PROTECTED]> wrote:
Hi Willem,

> I want to display an image from a database in an ImageControl,
> straight from a macro.
> I know how to get the binary data out of the database.
> But I cannot seem to find out how to display that image.
> What I have already tried is, to create in
> com.sun.star.io.XInputStream, by using getBinaryStream on the
> resultset, but the ImageControl want a
> com.sun.star.io.XObjectInputStream as the input of the read method.
> How can I convert the XInputStream to the XObjectInputStream?

read is a method of css.io.XPersisObject, and intended to read the
object itself - i.e. the image control model - from the given stream.
That's not what you want to use, believe me :)

Unfortunately, there are only two ways how to put an image into the control:
- the ImageURL property, pointing to an image file
- the connection to a binary database column

Since you say your image results from a database column, I wonder why
you need explicit macros. Normally, it should be sufficient to put the
control into a dedicated logical form, bind this form to your
database/table, and the control to the binary column in question.

If you definately need macros, then your only option is to write the
image into a (temporary) file, and set the ImageURL property appropriately.


Since both options are not really satisfying, you might want to submit
an issue requesting that an image control can be fed with an image
explicitly. Should not be too difficult to implement.

Ciao
Frank

--
- Frank Schönheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Database                   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to