xBitmap from Byte Array

The Application Programming Interface and the OASIS Open Document Format

xBitmap from Byte Array

Postby metz » Thu Sep 20, 2012 8:27 am

Good time of the day, community.
I'm very new to OpenOffice API thus I have a question:
My goal is to create an XShape with XBitmap as background.
I understand how to set some necessary properties to make my Shape use a "picture" as background, my problem is that I simply don't know how to create XBitmap from ByteArray (from QByteArray to be specific as I'm developing Qt/C++ library) which contains picture. Shape is a RectangleShape, I'm also wondering if i have to specify any size attributes of background to make it fill the Shape lock up stock and barrel (completely).
LibreOffice 3.1 under Redhat Linux
metz
 
Posts: 1
Joined: Thu Sep 20, 2012 8:08 am

Re: xBitmap from Byte Array

Postby Charlie Young » Thu Sep 20, 2012 1:33 pm

metz wrote:Good time of the day, community.
I'm very new to OpenOffice API thus I have a question:
My goal is to create an XShape with XBitmap as background.
I understand how to set some necessary properties to make my Shape use a "picture" as background, my problem is that I simply don't know how to create XBitmap from ByteArray (from QByteArray to be specific as I'm developing Qt/C++ library) which contains picture. Shape is a RectangleShape, I'm also wondering if i have to specify any size attributes of background to make it fill the Shape lock up stock and barrel (completely).


I have played with XBitmap in c++ some, including filling a RectangleShape, but never with a QByteArray, so I can't help with that right off the bat. Googling I found this, which purports to show how to convert bytes to bits and vice-versa, but i can't vouch for it.

You can use XUnitConversion->convertSizeToPixel to assure that that the XBitmap is created the same size as the RectangleShape. I think I can help here.

I suspect a moderator will want to move this to the macro forum, where we can discuss it further.
Apache OpenOffice 4.1.1
Windows XP
User avatar
Charlie Young
Volunteer
 
Posts: 1559
Joined: Fri May 14, 2010 1:07 am


Return to UNO API and ODF

Who is online

Users browsing this forum: No registered users and 2 guests