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]

Reply via email to